|
Re: Python 3K or Python 2.9?
|
Posted: Sep 11, 2007 5:06 PM
|
|
Bruce: I fully agree with the points you made about the lack of true concurrency support in Python, and the fact that addressing this could really help Python to gain further adoption.
But I am wondering about your proposed agent based approach. The restriction to messages as the only means of communication between threads certainly makes them easy to write and maintain. However, even with today's threading module combined with the use of the standard queue, I can accomplish something very similar (albeit without concurrency support), as a previous poster already had pointed out.
As I have been trying to communicate, there are plenty of applications I can think of, where access to a shared data structure would be the more efficient means of solving a problem. Sending messages always comes with an overhead.
Sure, if you have shared data structures you will have to deal with all the usual issues. But it's possible to do that, and it has been done before. I would at least like to have the choice. If you don't want to deal with the shared data, you can still use threads and queues to get the agents you desire. Therefore, I would say that today's threading API is not bad, since it gives you the flexibility.
In the end, though, a simple, platform independent and standard (included) way to use agents or something similar is still preferable over what we have today. Since such an approach can be implemented as a library, it would have at least a chance to be available one day.
|
|