[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.programming

Please reread about my SemaCondvar and SemaMonitor

Ramine

1/2/2016 9:06:00 PM

Hello,

My inventions that are my SemaMonitor and SemaCondvar were updated to
version 1.4, i have added an iterator on the FIFO Queue to make
WaitersBlocked()(that's the number of blocked threads on the SemaMonitor
or the SemaCondvar) works correctly, and you can wait indefinitly or for
a time-out interval in milliseconds.

You have to know that my SemaMonitor and SemaCondvar synchronization
objects combines all the characteristics of a Semaphore and also an
EventCount and also a windows Manual-reset event and also a windows
Auto-reset event and they are portable to Windows,Linux and OSX on x86
architecture.

You can download my SemaMonitor and SemaCondvar from:

https://sites.google.com/site/aminer68/semacondvar-s...

You will find both of the SemaMonitor and SemaCondvar classes inside
the file called SemaCondvar.pas

Author: Amine Moulay Ramdane.

Description:

SemaCondvar and SemaMonitor are new and portable synchronization objects
, SemaCondvar combines all the characteristics of a semaphore and a
condition variable and also a windows Manual-reset event and also
windows Auto-reset event, and SemaMonitor combines all charateristics of
a semaphore and an eventcount and also a windows Manual-reset event and
also windows Auto-reset event, they only use an event object and and a
very fast and very efficient and portable FIFO fair Lock , so they are
fast and they are FIFO fair and and they are portable to Windows,Linux
and OSX on x86 architecture.

I feel that i must explain to you how do work my inventions that are my
SemaCondvar and SemaMonitor objects, you will find those classes inside
the SemaCondvar.pas file inside the zip file, SemaCondvar and
SemaMonitor are new and portable synchronization objects , SemaCondvar
combines all the charateristics of a semaphore and a condition variable
and SemaMonitor combines all charateristics of a semaphore and an
eventcount , they only use an event object and a very fast and efficient
and portable FIFO fair Lock , so they are fast and they are FIFO fair.

When you set the first parameter of the construction to true it will add
the characteristic of a Semaphore to the condition variable or to the
Eventcount, so the signal will not be lost if the threads are not
waiting for the SemaCondvar or SemaMonitor objects, but when you set the
forst parameter of the construtor to false it will not behave like a
Semaphore because if the threads are not waiting for the SemaCondvar or
SemaMonitor the signal will be lost..

Now you can pass the SemaCondvar's or Semamonitor's initialcount and
SemaCondvar's or SemaMonitor's MaximumCount to the construtor, it's like
the windows Semaphore`s InitialCount and the Semaphore's MaximumCount.

Like this:

t:=TSemaMonitor.create(true,0,4);

You have 5 options in the defines.inc file for setting the kind of
locks, just look inside defines.inc , if you want to set it for the
Mutex that is energy efficient because it blocks the threads, uncomment
the option Mutex, if you want to set it for my node based scalable Lock,
uncomment the option MLock, if you want to set it for my scalable array
based lock called AMLock just uncomment the option AMLock inside
defines.inc, if you want to set it for Ticket Spinlock just uncomment
the option TicketSpinlock ,If you want to set it for Spinlock just
uncomment the option Spinlock.

Here is the methods that i have implemented :

TSemaCondvar = class
public

constructor
Create(m1:TCriticalSection;state1:boolean=false;InitialCount1:long=0;MaximumCount1:long=INFINITE);
destructor Destroy; override;
function wait(mstime:longword=INFINITE):boolean;
procedure signal();overload;
procedure signal_all();
procedure signal(nbr:long);overload;
function WaitersBlocked:integer;
end;

TSemaMonitor = class
public
constructor
Create(state1:boolean=false;InitialCount1:long=0;MaximumCount1:long=INFINITE);
destructor Destroy; override;
function wait(mstime:longword=INFINITE):boolean;
procedure signal();overload;
procedure signal_all();
procedure signal(nbr:long);overload;
function WaitersBlocked:integer;
procedure setSignal;
procedure resetSignal;
end;
Language: FPC Pascal v2.2.0+ / Delphi 7+: http://www.freep...

Operating Systems: Windows, Mac OSX , Linux...

Required FPC switches: -O3 -Sd -dFPC -dFreePascal

-Sd for delphi mode....

Required Delphi switches: -DMSWINDOWS -$H+ -DDelphi

For Delphi XE-XE7 use the -DXE switch

{$DEFINE CPU32} and {$DEFINE Windows32} for 32 bit systems

{$DEFINE CPU64} and {$DEFINE Windows64} for 64 bit systems


Thank you,
Amine Moulay Ramdane.
4 Answers

ChasNemo

9/4/2008 2:04:00 AM

0

On Sep 3, 9:53?pm, Harold Burton <hal.i.bur...@hotmail.com> wrote:
> In article
> <a62a7bc0-1bcf-4397-8ee6-6e940a920...@m45g2000hsb.googlegroups.com>,
>
> ?ChasNemo <chasn...@aol.com> wrote:
> > You arrogant, braindead, KKKowardly, sleazy, traitorous, rightarded
> > whores obviously don't care about "amything" that tragically affects
> > real people -- including your WMD lies and your totally bogus Iraq
> > War. ?You merely project and repeat your bullshit. ?Here's sincere
> > hoping that you and yours get a really deadly dose of what you've done
> > to and wished on others. ?Gospel.
>
> Someone's off her meds.
>
> Snicker.

You're projecting again, Harriet Burton. We *know* you're hurtin'.
Not that anyone gives a rat's ass. <snicker>

ChasNemo

9/4/2008 2:10:00 AM

0

On Sep 3, 10:08?pm, Harold Burton <hal.i.bur...@hotmail.com> wrote:
> In article
> <3e237a92-e261-4668-89aa-d3b973a8d...@k36g2000pri.googlegroups.com>,
>
>
>
>
>
> ?ChasNemo <chasn...@aol.com> wrote:
> > On Sep 3, 9:53?pm, Harold Burton <hal.i.bur...@hotmail.com> wrote:
> > > In article
> > > <a62a7bc0-1bcf-4397-8ee6-6e940a920...@m45g2000hsb.googlegroups.com>,
>
> > > ?ChasNemo <chasn...@aol.com> wrote:
> > > > You arrogant, braindead, KKKowardly, sleazy, traitorous, rightarded
> > > > whores obviously don't care about "amything" that tragically affects
> > > > real people -- including your WMD lies and your totally bogus Iraq
> > > > War. ?You merely project and repeat your bullshit. ?Here's sincere
> > > > hoping that you and yours get a really deadly dose of what you've done
> > > > to and wished on others. ?Gospel.
>
> > > Someone's off her meds.
>
> > > Snicker.
>
> > You're projecting again, Harriet Burton.
> > We know you're hurtin'.
> > Not that anyone gives a rat's ass.
>
> Got that right.
>
> Snicker.- Hide quoted text -
>
> - Show quoted text -

<yawwwwwwwwwn>

theloneranger100@aol.com

9/4/2008 4:23:00 AM

0

On Sep 3, 7:10?pm, ChasNemo <chasn...@aol.com> wrote:
> On Sep 3, 10:08 pm, Harold Burton <hal.i.bur...@hotmail.com> wrote:
>
>
>
>
>
> > In article
> > <3e237a92-e261-4668-89aa-d3b973a8d...@k36g2000pri.googlegroups.com>,
>
> > ChasNemo <chasn...@aol.com> wrote:
> > > On Sep 3, 9:53?pm, Harold Burton <hal.i.bur...@hotmail.com> wrote:
> > > > In article
> > > > <a62a7bc0-1bcf-4397-8ee6-6e940a920...@m45g2000hsb.googlegroups.com>,
>
> > > > ?ChasNemo <chasn...@aol.com> wrote:
> > > > > You arrogant, braindead, KKKowardly, sleazy, traitorous, rightarded
> > > > > whores obviously don't care about "amything" that tragically affects
> > > > > real people -- including your WMD lies and your totally bogus Iraq
> > > > > War. ?You merely project and repeat your bullshit. ?Here's sincere
> > > > > hoping that you and yours get a really deadly dose of what you've done
> > > > > to and wished on others. ?Gospel.
>
> > > > Someone's off her meds.
>
> > > > Snicker.
>
> > > You're projecting again, Harriet Burton.
> > > We know you're hurtin'.
> > > Not that anyone gives a rat's ass.
>
> > Got that right.
>
> > Snicker.- Hide quoted text -
>
> > - Show quoted text -
>
> <yawwwwwwwwwn>- Hide quoted text -
>
> - Show quoted text -

Your Knees are Trembling, Charlene............

ChasNemo

9/4/2008 1:22:00 PM

0

On Sep 4, 12:22?am, Screen Beret <ScreenBeret...@aol.com> wrote:
> On Sep 3, 7:10 pm, ChasNemo <chasn...@aol.com> wrote:
>
>
>
>
>
> > On Sep 3, 10:08 pm, Harold Burton <hal.i.bur...@hotmail.com> wrote:
>
> > > In article
> > > <3e237a92-e261-4668-89aa-d3b973a8d...@k36g2000pri.googlegroups.com>,
>
> > > ChasNemo <chasn...@aol.com> wrote:
> > > > On Sep 3, 9:53?pm, Harold Burton <hal.i.bur...@hotmail.com> wrote:
> > > > > In article
> > > > > <a62a7bc0-1bcf-4397-8ee6-6e940a920...@m45g2000hsb.googlegroups.com>,
>
> > > > > ?ChasNemo <chasn...@aol.com> wrote:
> > > > > > You arrogant, braindead, KKKowardly, sleazy, traitorous, rightarded
> > > > > > whores obviously don't care about "amything" that tragically affects
> > > > > > real people -- including your WMD lies and your totally bogus Iraq
> > > > > > War. ?You merely project and repeat your bullshit. ?Here's sincere
> > > > > > hoping that you and yours get a really deadly dose of what you've done
> > > > > > to and wished on others. ?Gospel.
>
> > > > > Someone's off her meds.
>
> > > > > Snicker.
>
> > > > You're projecting again, Harriet Burton.
> > > > We know you're hurtin'.
> > > > Not that anyone gives a rat's ass.
>
> > > Got that right.
>
> > > Snicker.- Hide quoted text -
>
> > > - Show quoted text -
>
> > <yawwwwwwwwwn>- Hide quoted text -
>
> > - Show quoted text -
>
> Your Knees are Trembling, Charlene............- Hide quoted text -
>
> - Show quoted text -

Have you been reading the National Enquirer stories about Sarah
Barracuda? (That's the rag you cited as reliable. Remember?)