Re: Problems in 1.3.93

Alan Cox (alan@lxorguk.ukuu.org.uk)
Tue, 23 Apr 1996 22:38:10 +0100 (BST)


> Easy, you don't use semaphores, you use a shared named pipe. Write one
> character for an up() operation, read one for down().

If you have semaphores in a loop done this way and you write more than
4096 or 5120 ups/downs in a row you can deadlock. More seriously a big
pile of these can run out of streams resources on smaller SYS5.3/4 boxes
with sometimes amusing (except for the admin) results.

Furthermore good sys5 semaphore code is faster. Short of doing clever
tricks with shared memory and signals I dont know anything quicker.

Alan