Re: lock, mutex etc.

Chris Wedgwood (chris@cybernet.co.nz)
Wed, 22 Jul 1998 00:19:11 +1200


On Tue, Jul 21, 1998 at 04:50:08PM +0530, Somnath Roy wrote:

> Is there any lock/mutex primitives available for Linux kernel to use ? How
> the shared data is protected from multiple kernel processes ?

libpthread has some (POSIX defined?) mutex and similar primitives.

If the kernel is compiled with sysv IPC (almost all will be) then you can
use the sysV semaphores (man ipc).

If you want to protect shared data between applications, where the locking
is only for a very short amount of time, you can use spinlocks.

-cw

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html