Re: Preventing tread collisions

2012-12-13 Thread Andrew Robinson
On 12/12/2012 12:29 PM, Dave Angel wrote: On 12/12/2012 03:11 PM, Wanderer wrote: I have a program that has a main GUI and a camera. In the main GUI, you can manipulate the images taken by the camera. You can also use the menu to check the camera's settings. Images are taken by the camera in a s

Re: Preventing tread collisions

2012-12-13 Thread Wanderer
On Thursday, December 13, 2012 11:54:10 AM UTC-5, Dave Angel wrote: > On 12/13/2012 11:36 AM, Wanderer wrote: > > > > > > > > > Thanks. Why Non-blocking? > > > > You said you didn't want the GUI to lock up. Non-blocking lets you > > choose alternative action when you would otherwise have t

Re: Preventing tread collisions

2012-12-13 Thread Dave Angel
On 12/13/2012 11:36 AM, Wanderer wrote: > > > Thanks. Why Non-blocking? You said you didn't want the GUI to lock up. Non-blocking lets you choose alternative action when you would otherwise have to wait for the resource. -- DaveA -- http://mail.python.org/mailman/listinfo/python-list

Re: Preventing tread collisions

2012-12-13 Thread Wanderer
On Wednesday, December 12, 2012 3:53:28 PM UTC-5, MRAB wrote: > On 2012-12-12 20:11, Wanderer wrote: > > > I have a program that has a main GUI and a camera. In the main GUI, you can > > manipulate the images taken by the camera. You can also use the menu to > > check the camera's settings. Imag

Re: Preventing tread collisions

2012-12-13 Thread Ian Kelly
On Thu, Dec 13, 2012 at 3:26 AM, Alexander Blinne wrote: > I have a general question about this kinds of things. I see that the > above is a common use case for some kind of lock which does this > testing/locking atomically. But the question is: if I know for sure that > there is no other thread t

Re: Preventing tread collisions

2012-12-13 Thread Alexander Blinne
Am 12.12.2012 21:29, schrieb Dave Angel: > On 12/12/2012 03:11 PM, Wanderer wrote: >> I have a program that has a main GUI and a camera. In the main GUI, you can >> manipulate the images taken by the camera. You can also use the menu to >> check the camera's settings. Images are taken by the came

Re: Preventing tread collisions

2012-12-12 Thread MRAB
On 2012-12-12 20:58, Ian Kelly wrote: On Wed, Dec 12, 2012 at 1:53 PM, MRAB wrote: You could try a non-blocking semaphore: def __init__(self): self.cameraActive = Semaphore() Why a Semaphore and not just a plain old Lock? Good point. I probably thought of a semaphore because the OP men

Re: Preventing tread collisions

2012-12-12 Thread Ian Kelly
On Wed, Dec 12, 2012 at 1:53 PM, MRAB wrote: > You could try a non-blocking semaphore: > > def __init__(self): > self.cameraActive = Semaphore() Why a Semaphore and not just a plain old Lock? -- http://mail.python.org/mailman/listinfo/python-list

Re: Preventing tread collisions

2012-12-12 Thread MRAB
On 2012-12-12 20:11, Wanderer wrote: I have a program that has a main GUI and a camera. In the main GUI, you can manipulate the images taken by the camera. You can also use the menu to check the camera's settings. Images are taken by the camera in a separate thread, so the long exposures don't

Re: Preventing tread collisions

2012-12-12 Thread Dave Angel
On 12/12/2012 03:11 PM, Wanderer wrote: > I have a program that has a main GUI and a camera. In the main GUI, you can > manipulate the images taken by the camera. You can also use the menu to check > the camera's settings. Images are taken by the camera in a separate thread, > so the long exposu

Preventing tread collisions

2012-12-12 Thread Wanderer
I have a program that has a main GUI and a camera. In the main GUI, you can manipulate the images taken by the camera. You can also use the menu to check the camera's settings. Images are taken by the camera in a separate thread, so the long exposures don't block the GUI. I block conflicts betwe