[Twisted-Python] Concurrent data access with select() safe?

Matt Campbell mattcampbell at pobox.com
Tue Aug 13 14:28:42 EDT 2002


On Wed, Aug 14, 2002 at 02:09:19AM +0800, Mukhsein Johari wrote:
> I've managed to get a working custom webserver thanks to Donovan. My next 
> question is (perhaps more due to my ignorance of how select works) how do you
> control concurrent access to data?

There is no concurrent access to data in a single-threaded,
event-based system, because the event handlers which are run by
the main loop are never interrupted.  A function always runs to
completion, as if it's always running in a critical section. (This
is also why no blocking system calls should be performed except in
the main loop itself.)
-- 
Matt Campbell
Email and MSN Messenger:  mattcampbell at pobox.com
Web site:  http://www.pobox.com/~mattcampbell/




More information about the Twisted-Python mailing list