On Fri, 2004-09-10 at 00:00 -0300, Martim Carbone wrote: > Is it really a deadlock? Let's assume the following scenario: > > - Thread 1 acquires lock A (spinlock) and gets preempted > - Thread 2 tries to acquire lock A and spins > - At some point in the future, the system timer interrupts thread 2, > determines that its timeslice has finished and sets need_resched. Some > other process it scheduled > - After X reschedules, thread 1 is once again scheduled and releases lock A. > - After Y reschedules, thread 2 is once again scheduled and, this > time, lock A is free, so it acquires the lock and executes the > critical region. Are you serious? I suppose in this example, assuming that T2 is always suspended and that T1 is always rescheduled, you do not have a deadlock, but an indefinite postponement, although this is not much more acceptable than a straight up deadlock. Robert Love -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/