* Help : Problem with System V Semaphores
@ 1995-08-08 4:00 Irene Seah
1995-08-08 4:00 ` Ron Natalie
0 siblings, 1 reply; 2+ messages in thread
From: Irene Seah @ 1995-08-08 4:00 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Help : Problem with System V Semaphores
1995-08-08 4:00 Help : Problem with System V Semaphores Irene Seah
@ 1995-08-08 4:00 ` Ron Natalie
0 siblings, 0 replies; 2+ messages in thread
From: Ron Natalie @ 1995-08-08 4:00 UTC (permalink / raw)
Irene Seah (davidtfh@slip.technet.sg) wrote:
: My questions are :
: 1. Why Process 3 get the resource instead of Process 2?
: 2. Isn't it the access of semaphores FIFO
No, SYSV semaphores are defined to be LIFO. Pretty damn useless
isn't it?
-Ron
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1995-08-08 4:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1995-08-08 4:00 Help : Problem with System V Semaphores Irene Seah
1995-08-08 4:00 ` Ron Natalie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox