From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,b0976a8a5ec88971,start X-Google-Attributes: gid1164f8,public From: davidtfh@slip.technet.sg (Irene Seah) Subject: Help : Problem with System V Semaphores Date: 1995/08/08 Message-ID: <4069u7$1lm@raffles.technet.sg>#1/1 X-Deja-AN: 107681988 organization: Technet, Singapore keywords: System V Semaphores mime-version: 1.0 reply-to: davidtfh@technet.sg newsgroups: comp.sys.dec Hi! Currently, I faced some difficulty dealing with the above semaphores. There are three processes that are trying to access a common resource. The access of this common resource is controlled with the use of System V IPC-Semaphores (with undo facility). The problem that I faced is as follows Process 1 is currently accessing the common resource say at 00:00:00 (semphore is locked). Process 2 at 00:00:45 is trying to access the resource followed by Process 3 at 0:02:50 is trying to access too. The problem is why Process 3 get the resource instead of Process 2 at 0:04:10. On top of that, when Process 1 retries, it manages to get the resource back at 0:05:45. Process 2 only manage to get the resource at 0:07:00. The above processes are running in the same priority (not set). The system that the processes are run on is DEC ALPHA OSF/1 I have tried using the scheduler to set a higher priority for process 2 but results in the kernel allocating too much timeslice for process 2 and this is undesirable. My questions are : 1. Why Process 3 get the resource instead of Process 2? 2. Isn't it the access of semaphores FIFO 3. If Process 2 loses its timeslice, why it only manage to get it back after 7 minutes? 4. Is there any way that every process has a equal chance to access the resource? That is, the first to request will be the first to get it. Urgently requires some advice!!! Thanks Irene