Re: [linux-audio-dev] sysv semaphores instead of pipes

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] sysv semaphores instead of pipes
From: Paul Davis (pbd_AT_Op.Net)
Date: Tue Jun 26 2001 - 17:47:33 EEST


>> the problem with semaphores is that Unix/POSIX semantics don't allow
>> integration of a process sleeping on an file descriptor and a
>> semaphore (one of the few areas where Windows definitely improves upon
>> Unix). this would mean adding yet another thread that just sleeps on
>
>Would it be at all possible to use SysV IPC for everything? (Just a
>curious thought.)

well, you could use message queues instead of name pipes to deliver
data, but there are likely few advantages of using them over pipes and
possibly some disadvantages for small quantities of data.

if you try to use more than one kind of SysV IPC you run into the same
problem: Unix/POSIX doesn't integrate "wait-on" operations for
different OS objects. You can't sleep on a message queue *and* a
semaphore, or a message queue *and* a file descriptor etc. I'm not the
first person to make this observation, and one could consider it a
major weakness of the Unix API. Several versions of the win32 and
winNT API's fix this design flaw, though I don't know how good the
implementation is.

and of course, you can't wait on shared memory at all :)

so in short, probably not.

--p


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Tue Jun 26 2001 - 17:49:32 EEST