• My inventions that are my SemaMonitor and my SemaCondvar were updated t

    From Wisdom90@21:1/5 to All on Tue Dec 31 10:38:21 2019

    My inventions that are my SemaMonitor and my SemaCondvar were updated to version 2.3, they have become efficient and powerful, please read the
    readme file to know more about the changes, and i have implemented an
    efficient Monitor over my SemaCondvar. Here is the description of my
    efficient Monitor inside the Monitor.pas file that you will find inside
    the zip file:


    This is my implementation of a Monitor over my SemaCondvar.

    You will find the Monitor class inside the Monitor.pas file inside the
    zip file.

    When you set the first parameter of the constructor to true, the signal
    will not be lost if the threads are not waiting with wait() method, but
    when you set the first parameter of the construtor to false, if the
    threads are not waiting with the wait() method, the signal will be lost..

    Second parameter of the constructor is the kind of Lock, you can
    set it to ctMLock to use my scalable node based lock called MLock, or
    you can set it to ctMutex to use a Mutex or you can set it to
    ctCriticalSection to use the TCriticalSection.

    Here is the methods of my efficient Monitor that i have implemented:

    TMonitor = class


    constructor Create(bool:boolean=true;lock:TMyLocks=ctMLock);
    destructor Destroy; override;
    procedure Enter();
    procedure Leave();
    function Signal():boolean;overload;
    function Signal(nbr:long;var remains:long):boolean;overload;
    procedure Signal_All();
    function Wait(const AMilliseconds:longword=INFINITE): boolean;
    function WaitersBlocked():long;


    The wait() method is for the threads to wait on the Monitor object for
    the signal to be signaled. If wait() fails, that can be that the number
    of waiters is greater than high(longword).

    And the signal() method will signal one time a waiting thread on the
    Monitor object, but if signal() fails , the returned value is false.

    the signal_all() method will signal all the waiting threads on the
    Monitor object.

    The signal(nbr:long;var remains:long) method will signal nbr of waiting threads, but if signal() fails, the remaining number of signals that
    were not signaled will be returned in the remains variable.

    and WaitersBlocked() will return the number of waiting threads on the
    Monitor object.

    and Enter() and Leave() methods to enter and leave the monitor's Lock.

    You can download the zip files from:


    and the lightweight version is here:


    Thank you,
    Amine Moulay Ramdane.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)