Hello,
I have invented my SemaCondvar and my SemaMonitor, and
i have just upgraded my SemaMonitor, my new SemaMonitor
is a combination of a Semaphore and EventCount, and it
supports also the charracteristics of a windows manual
event object and a windows automatic event object and
it is FIFO fair and starvation-free. the windows event
object is FIFO fair nor starvatoin free.. and my SemaCondvar
is a combination of a Semaphore and a Condition variable.
Here is the new interface that i have implemented:
TSemaCondvar = class
public
constructor
Create(m1:TCriticalSection;state1:boolean=false;InitialCount1:longword=0;MaximumCount1:longword=INFINITE);
destructor Destroy; override;
function wait(mstime:longword=INFINITE):boolean;
procedure signal();overload;
procedure signal_all();
procedure signal(nbr:integer);overload;
function WaitersBlocked:integer;
end;
TSemaMonitor = class
public
constructor
Create(state1:boolean=false;InitialCount1:longword=0;MaximumCount1:longword=INFINITE);
destructor Destroy; override;
function wait(mstime:longword=INFINITE):boolean;
procedure signal();overload;
procedure signal_all();
procedure signal(nbr:integer);overload;
function WaitersBlocked:integer;
procedure setSignal;
procedure resetSignal;
end;
You can download my new SemaCondvar and SemaMonitor from:
http://pages.videotron.com/aminer/
Thank you,
Amine Moulay Ramdane.