Re: atomic section in code

2008-09-07 Thread Diez B. Roggisch
Hendrik van Rooyen schrieb: Fredrik Lundh wrote: sounds like he wants/needs non-cooperative, mandatory locking. Could one get there using ctypes to disable interrupts? Not as such, ctypes can't execute arbitrary machine code. But of course you can create a C-lib that does what you want (I

Re: atomic section in code

2008-09-06 Thread Tim Roberts
"Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: > >Fredrik Lundh wrote: > >>sounds like he wants/needs non-cooperative, mandatory locking. More accurately, he THINKS he wants/needs mandatory locking. We need to find out what he's really trying to accomplish before we can suggest something that i

Re: atomic section in code

2008-09-06 Thread Hendrik van Rooyen
Fredrik Lundh wrote: >sounds like he wants/needs non-cooperative, mandatory locking. Could one get there using ctypes to disable interrupts? Cross Platform? I can think of lots of hassles, starting with permissions to use the privileged instructions. - Hendrik -- http://mail.python.org/mai

Re: atomic section in code

2008-09-05 Thread Fredrik Lundh
Diez B. Roggisch wrote: AFAIC that kind of mutual exclusion is what atomicity is about. What else do you expect to happen? sounds like he wants/needs non-cooperative, mandatory locking. -- http://mail.python.org/mailman/listinfo/python-list

Documentation (was Re: atomic section in code)

2008-09-05 Thread Fredrik Lundh
Michele Simionato wrote: The page you link here is WAYS better than the standard documentation of the threading module. Generally speaking, the effbot zone contains a lot of improvements over the standard docs which are lacking in various areas. I have always wondered why they are kept separated

Re: atomic section in code

2008-09-05 Thread Michele Simionato
On Sep 5, 10:59 am, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > > 1) seehttp://effbot.org/zone/thread-synchronization.htm The page you link here is WAYS better than the standard documentation of the threading module. Generally speaking, the effbot zone contains a lot of improvements over the standa

Re: atomic section in code

2008-09-05 Thread Diez B. Roggisch
Ahmad Humayun schrieb: On Sep 5, 1:59 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: Ahmad Humayun wrote: I need to create an atomic section in Python code i.e. there is no context switch to any other thread during the running of that piece of code. Would would do the trick? use a lock, and make

Re: atomic section in code

2008-09-05 Thread Ahmad Humayun
On Sep 5, 1:59 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Ahmad Humayun wrote: > > I need to create an atomic section in Python code i.e. there is no > > context switch to any other thread during the running of that piece of > > code. Would would do the trick? > > use a lock, and make sure that

Re: atomic section in code

2008-09-05 Thread Fredrik Lundh
Ahmad Humayun wrote: I need to create an atomic section in Python code i.e. there is no context switch to any other thread during the running of that piece of code. Would would do the trick? use a lock, and make sure that anyone that needs access to the shared state you're manipulating in tha

atomic section in code

2008-09-05 Thread Ahmad Humayun
Hi there, I need to create an atomic section in Python code i.e. there is no context switch to any other thread during the running of that piece of code. Would would do the trick? thanks, -- http://mail.python.org/mailman/listinfo/python-list