Hi All,
I am confused abt the differences and usage(when and where) of these
mechanisms. I think they are one and the same with the concept wise(I dont'
know I am correct or not). Can anybody help me out in understing these primitives?
Hi,
Have a look at the kernel-locking guide. you can find it on the docbooks of the linux kernel sources.
The big difference between semaphores and spinlocks is that semaphore will put the process in a sleeping state and the spinlock not (the process will execute a loop with only the test).
So semaphores can only be used in a process context, where the current struct is avalaible...
But have a look at the kernel-locking guide, it's very good :)
-- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/