I guess that if the blocking time will be long, i have to use a semaphore. But on my driver, this time depends on the user operations and can vary from seconds to minutes. Well in fact, even a second is long for a processor. But you see what i mean i'm sure :)
By reading the linux source code, i found a lot of spinlocks and few (less than spinlocks :) ) semaphores. So spinlocks are really the prefered synchronization method ?
-- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/