[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.programming

About my C++ synchronization objects library

Ramine

5/4/2016 11:49:00 PM

Hello,

My SemaMonitor of C++ synchronization objects library is
easy to use, it combines the combines all characteristics of a semaphore
and an eventcount and also a windows Manual-reset event and also a
windows Auto-reset event, here is its C++ interface:

class SemaMonitor{
public:
SemaMonitor(bool state, long2 InitialCount1=0,long2
MaximumCount1=INFINITE);
~SemaMonitor();

void wait(unsigned long mstime=INFINITE);
void signal();
void signal_all();
void signal(long2 nbr);
void setSignal();
void resetSignal();
long1 WaitersBlocked();
};


So when you set the first parameter that is state of the constructor to
true. it will add the characteristic of a Semaphore to the to the
Eventcount, so the signal will not be lost if the threads are not
waiting for the SemaMonitor objects, but when you set the first
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..

the parameters InitialCount1 and MaximumCount1 is the semaphore
InitialCount and MaximumCount.

The wait() method is for the threads to waiT on the SemaMonitor
object for the signal to be signaled.

and the signal() method will signal one time awaiting thread on the
SemaMonitor object.

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

the signal(long2 nbr) method will signal nbr number of waiting threads

the setSignal() and resetSignal() methods behave like the windows Event
object's methods that are setEvent() and resetEvent().

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


As you have noticed my SemaMonitor is a powerful synchronization object.


You can download this library from:

https://sites.google.com/site/aminer68/c-synchronization-objec...


Thank you,
Amine Moulay Ramdane.

Thank you,
Amine Moulay Ramdane.





1 Answer

Tiger Luck

9/4/2008 5:27:00 AM

0

DG wrote:
> "Jorge Duhbya Arbusto, POTUS \(Retired\)"
> <cleanin_the_stables@fakeranch.tx> wrote:
>> Tiger Luck wrote:
>>> Couldn't tell from the RNC.
>>>
>>> Bush got swept away by Gustav and no one threw him a rope.
>> They should've thrown him a rope....with noose on the end.....
>
>
>
> Biden said they would pursue criminal charges for criminal activities
> all the way up to and including bushie.


Where?

Post a link or dry up.


>
> He's scared shitless...
>
>
> -= http://www.flickr.com/photos/ros... =-
>


--
Einstein forgot to carry the two