[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.programming

About my SemaCondvar and SemaMonitor...

Ramine

11/16/2015 2:29:00 AM


Hello,


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.


That's all.

You can download my SemaMonitor and SemaCondvar from:

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

and from:

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



Thank you,
Amine Moulay Ramdane.