Re: [LAD] [somewhat OT] semaphores in python

2008-08-27 Thread Forest Bond
Hi, On Tue, Aug 26, 2008 at 11:14:05PM +0200, Fons Adriaensen wrote: > On Tue, Aug 26, 2008 at 11:02:37PM +0200, Dominic Sacré wrote: > > > Is this really an issue in Python? The Python interpreter is not thread > > safe > > anyway, there's a global interpreter lock that must be held by any thr

Re: [LAD] [somewhat OT] semaphores in python

2008-08-27 Thread Emanuel Rumpf
2008/8/26 Fons Adriaensen <[EMAIL PROTECTED]>: > > BUT: the python interpreter will release the GIL every > so many bytecode instructions. There is AFAICS nothing > that would prevent it from doing this in between the two > operations that have to be atomic - it doesn't know they > have to be. > M

Re: [LAD] [somewhat OT] semaphores in python

2008-08-26 Thread Robin Gareus
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Fons Adriaensen wrote: > On Tue, Aug 26, 2008 at 11:02:37PM +0200, Dominic Sacr� wrote: > >> Is this really an issue in Python? The Python interpreter is not thread safe >> anyway, there's a global interpreter lock that must be held by any thread >>

Re: [LAD] [somewhat OT] semaphores in python

2008-08-26 Thread Fons Adriaensen
On Tue, Aug 26, 2008 at 11:14:05PM +0200, Fons Adriaensen wrote: > To make all of this work correctly in all conditions, the > essential part is that one can do [wait (S), release (M)] > atomically. And of course also [return from wait (S), acquire (M)] -- FA Laboratorio di Acustica ed Elettr

Re: [LAD] [somewhat OT] semaphores in python

2008-08-26 Thread Fons Adriaensen
On Tue, Aug 26, 2008 at 11:02:37PM +0200, Dominic Sacré wrote: > Is this really an issue in Python? The Python interpreter is not thread safe > anyway, there's a global interpreter lock that must be held by any thread > accessing Python objects. > Depending on what you're trying to do, this migh

Re: [LAD] [somewhat OT] semaphores in python

2008-08-26 Thread Dominic Sacré
On Tuesday 26 August 2008 22:01:18 Fons Adriaensen wrote: > AFAICS, for this reason, whatever happens in threading > can't be correct, or at least not pre-emption and SMP > safe. Is this really an issue in Python? The Python interpreter is not thread safe anyway, there's a global interpreter lock

Re: [LAD] [somewhat OT] semaphores in python

2008-08-26 Thread Tim Goetze
[Fons Adriaensen] >Does anyone know of a counting semaphare class/module >in Python ? Given the lock provided by the built-in >thread module it seems impossible to implement this >(it does support multiple waiters which I don't need, >but definitely is not counting). This also means that >whatever

Re: [LAD] [somewhat OT] semaphores in python

2008-08-26 Thread Fons Adriaensen
On Tue, Aug 26, 2008 at 09:55:07PM +0200, Arnold Krille wrote: > Am Dienstag, 26. August 2008 schrieb Fons Adriaensen: > > Does anyone know of a counting semaphare class/module > > in Python ? Given the lock provided by the built-in > > thread module it seems impossible to implement this > > (it

Re: [LAD] [somewhat OT] semaphores in python

2008-08-26 Thread Arnold Krille
Am Dienstag, 26. August 2008 schrieb Fons Adriaensen: > Does anyone know of a counting semaphare class/module > in Python ? Given the lock provided by the built-in > thread module it seems impossible to implement this > (it does support multiple waiters which I don't need, > but definitely is not c

[LAD] [somewhat OT] semaphores in python

2008-08-26 Thread Fons Adriaensen
Hello all, Does anyone know of a counting semaphare class/module in Python ? Given the lock provided by the built-in thread module it seems impossible to implement this (it does support multiple waiters which I don't need, but definitely is not counting). This also means that whatever is defined i