Re: Simulating OS semaphore behavior
- From: "Anh Vo" <Anh.Vo@xxxxxxxxxxxxxx>
- Date: Thu, 31 Aug 2006 11:24:05 -0500
"REH" <spamjunk@xxxxxxxxxxx> 8/25/2006 8:25 AM >>>
Dmitry A. Kazakov wrote:
That looks like a classic automatic event for multiple tasks. MakeSignal
an entry:race
protected body Event is
entry Wait when Signal'Count > 0 is
begin
null;
end Wait;
entry Signal when Wait'Count = 0 is
begin
null;
end Signal;
end Event;
Signal is blocked until all waiting tasks get released. There is no
condition because fresh attempts to Wait are blocked if a signal is
pending.
Ah, just what I love: simple and elegant. Thank you!
It is just simply beautiful, sweet and elegant solution. I had
implemented similar to Jean-Pierre's. I already changed to Dmitry's
implementation. This is another reason that Ada is in my heart.
AV
.
- Prev by Date: GADBTK ATIP1553 GNAT?
- Next by Date: Looking For Information On The XD Ada Compiler (Reference Manual?) : How Is XD Ada Different From The 83/95 Standards : Thus What Are The Problems In Using XD Ada
- Previous by thread: Re: Simulating OS semaphore behavior
- Next by thread: Unix and Ada Programmer/Analyst with CSC @ Rockville MD
- Index(es):