Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!ucbvax!hplabs!hpda!hpcupt1!hpisoa1!vandys From: vandys@hpisoa1.HP.COM (Andrew Valencia) Newsgroups: comp.unix.wizards Subject: Re: P/V using SysV semop(2) Message-ID: <2200028@hpisoa1.HP.COM> Date: 25 Aug 88 16:02:30 GMT References: <1001@uwbull.uwbln.UUCP> Organization: Hewlett Packard, Cupertino Lines: 17 / hpisoa1:comp.unix.wizards / ckl@uwbln.UUCP (Christoph Kuenkel) / 6:45 am Aug 24, 1988 / >As far as i understand, the documentations does not specify anything at all. >i cant believe it. is it impossible to implement P/V without starvation? On many UNICES, the sleep queue isn't FIFO, unlike the run queue. This can result in real oddities of performance when just depending on sleep/wakeup for fairness (which the Sys V semaphore code I saw did). I believe that 4.3 has changed the sleep queues to FIFO, as have I for HP-UX. Surprisingly, nothing broke for either of us. Lacking this, an obvious and simple technique is to use a semaphore server process, accessed via messages. This process can then implement whatever policies he sees fit. Of course, if his policies include attributes like priority, he might have fun trying to figure out the true priorities of his client processes when faced with message forgeries. It goes. Andy