How to prevent from race conditions to share data between many process and thread in python

Diez B. Roggisch deets at nospam.web.de
Tue Feb 6 06:49:51 EST 2007


mars wrote:

> On 2月6日, 下午6时14分, "Diez B. Roggisch" <d... at nospam.web.de> wrote:
>> mars wrote:
>> > I use TurboGears to do some web service. TurboGears use cherrypy. When
>> > web browser access this site, the cherrypy will call my python
>> > program. So my program looks like a lib. When web browser access the
>> > site, the http server will fock a process or gerenate a thread. I need
>> > share some data or operate some files. How can I prevent from race
>> > conditions. Is there any way can I lock this.
>> > Thank you in advance!
>>
>> There are the Lock and RLock objects available in the module threading.
>>
>> Diez
> 
> Can this also lock mutil-process?

No.

Diez



More information about the Python-list mailing list