Re: I don't understand what is happening in this threading code

2008-01-21 Thread Tim Roberts
Matthew Wilson <[EMAIL PROTECTED]> wrote: >In this code, I tried to kill my thread object by setting a variable on it >to False. > >Inside the run method of my thread object, it checks a different >variable. > >I've already rewritten this code to use semaphores, but I'm just curious >what is going

Re: I don't understand what is happening in this threading code

2008-01-20 Thread Nir
On Jan 19, 2:43 am, Matthew Wilson <[EMAIL PROTECTED]> wrote: > In this code, I tried to kill my thread object by setting a variable on it > to False. > > Inside the run method of my thread object, it checks a different > variable. > > I've already rewritten this code to use semaphores, but I'm jus

Re: I don't understand what is happening in this threading code

2008-01-18 Thread Sergio Correia
This is what's happening: 1) The chef thread releases the sema 2) While the chef thread is saying "Andiamo", decreasing "i", and ending the while loop, the waiter thread SERVES the dish and RUNS to reacquire the lock 3) Back in the main loop, chef.join() is run, and then the waiter's variable i

Re: I don't understand what is happening in this threading code

2008-01-18 Thread Carl Banks
On Jan 18, 7:43 pm, Matthew Wilson <[EMAIL PROTECTED]> wrote: > In this code, I tried to kill my thread object by setting a variable on it > to False. > > Inside the run method of my thread object, it checks a different > variable. > > I've already rewritten this code to use semaphores, but I'm jus

I don't understand what is happening in this threading code

2008-01-18 Thread Matthew Wilson
In this code, I tried to kill my thread object by setting a variable on it to False. Inside the run method of my thread object, it checks a different variable. I've already rewritten this code to use semaphores, but I'm just curious what is going on. Here's the code: import logging, threading,