Re: SUMMARY: Kernel Threads Usable By Mortals

Alan Cox (alan@cymru.net)
Fri, 26 Apr 1996 23:32:59 +0100 (BST)


> calls which eventually will cause a kernel oops. Bet its nothing that
> a little more locking, some extra calls to verify_area(), and some
> extra error checking couldn't cure in a future release.

Its quite big to avoid deadlocks in some areas. The oops are non
fatal.

> The kernel does not provide any locking functions to help threads
> syncronise and not step all over each other. Apparently a locking
> mechanism could be hacked out of the IPC functions, but that is

The IPC functions provide semaphores with non deadlock semantics and
multiple simultaneous updates. They are precisely what people need.

> considered to be quite a dirty approach. Someone posted some code to
> the linux-smp list not long ago which implemented a spin lock in user
> mode by making use of the atomic compare and exchange instruction on
> the iX86. It is as atomic as can be, and is guaranteed

Please see lock_kernel() in the Linux source.