Friday, May 13, 2016

Digest for comp.programming.threads@googlegroups.com - 10 updates in 6 topics

Ramine <ramine@1.1>: May 12 06:02PM -0700

Hello...
 
 
My C++ Synchronization objects library was updated...
 
I have included the 32 bit and 64 bit C++Builder makefiles
 
and i have made my library follow the ISO C++ standard.
 
And i have corrected a bug.
 
And i have thoroughly tested it, and i think that you can
be more confident because it is more stable.
 
You can download my updated C++ Synchronization objects library from:
 
https://sites.google.com/site/aminer68/c-synchronization-objects-library
 
 
 
Thank you,
Amine Moulay Ramdane.
bleachbot <bleachbot@httrack.com>: May 12 04:19PM +0200

bleachbot <bleachbot@httrack.com>: May 12 07:45PM +0200

bleachbot <bleachbot@httrack.com>: May 13 12:00AM +0200

bleachbot <bleachbot@httrack.com>: May 13 12:13AM +0200

bleachbot <bleachbot@httrack.com>: May 13 03:01AM +0200

Ramine <ramine@1.1>: May 12 03:14PM -0700

Hello,
 
 
I have told you before that C++ was dangerous for parallelism,
because of its memory model that is weaker than the x86 architecture
memory model, but i have finally avoided this problem by implementing
my inventions with FreePascal and Delphi compilers that doesn't
reorder loads and stores even with compiler optimization, and
this is less error, so i have finally compiled my algorithms
implementations into Dynamic Link Libraries that
are used by C++ in a form of my great C++ Object Synchronization
Library. So C++ has become great again.
 
You can download my new and extended C++ Synchronization objects library:
 
https://sites.google.com/site/aminer68/c-synchronization-objects-library
 
 
 
Thank you,
Amine Moulay Ramdane.
Ramine <ramine@1.1>: May 12 03:00PM -0700

Hello,
 
My C++ Synchronization objects library was extended...
 
My previous invention was a scalable Asymmetric Distributed
Reader-Writer Mutex that uses a technic that looks like Seqlock without
looping on the reader side like Seqlock, and this has permited the
reader side to be costless.
 
I have finished implementing another implementation of a new algorithm
of mine, this one is a scalable Asymmetric Reader-Writer Mutex that is
not distributed, and it uses a technic that looks like Seqlock without
looping on the reader side like Seqlock, and this has permited the
reader side to be costless, and this one calls the windows
FlushProcessWriteBuffers() just one time, but the my asymmetric
distributed algorithm calls FlushProcessWriteBuffers() many times.
 
 
My scalable Asymmetric Distributed Reader-Writer Mutex and
my scalable Asymmetric Reader-Writer Mutex are suitable for
reatime critical systems, and i have just included them
my C++ Synchronization objects library.
 
 
You can download my new and extended C++ Synchronization objects library:
 
https://sites.google.com/site/aminer68/c-synchronization-objects-library
 
Author: Amine Moulay Ramdane
 
Email: aminer@videotron.ca
 
Description:
 
This library contains 9 synchronization objects, first one is my
scalable SeqlockX that is a variant of Seqlock that eliminates the
weakness of Seqlock that is "livelock"of the readers when there is more
writers, and second is my scalable MLock that is a scalable
lock , and third is my SemaMonitor that combines all characteristics
of a semaphore and an eventcount and also a windows
Manual-reset event and also a windows Auto-reset event, and fourth
is my scalable DRWLock that is a scalable reader-writer lock that is
starvation-free and it does spin-wait, and five is is my scalable
DRWLockX that is a scalable reader-writer lock that is
starvation-free and it doesn't spin-wait, but it waits on the Event
objects and my SemaMonitor, so it is energy efficient, and six one is
my scalable asymmetric DRWLock that doesn't use any atomic operations
and/or StoreLoad style memory barriers on the
reader side, so it look like RCU, and it is fast. This scalable
Asymmetric Distributed Reader-Writer Mutex is FIFO fair on the
writer side and FIFO fair on the reader side and of course it is
starvation-free and it does spin-wait, and seven one is my scalable
asymmetric DRWLockX that doesn't use any atomic operations
and/or StoreLoad style memory barriers on the reader side, so it
look like RCU, and it is fast. This scalable Asymmetric Distributed
Reader-Writer Mutex is FIFO fair on the writer side and FIFO fair on the
reader side and of course it is starvation-free, and it does not
spin-wait, but it waits on Event objects and my SemaMonitor, so it
is energy efficient, and eight is my LW_Asym_RWLockX that is a
lightweight scalable Asymmetric Reader-Writer Mutex that uses a technic
that looks like Seqlock without looping on the reader side
like Seqlock, and this has permited the reader side to be costless,
it is FIFO fair on the writer side and FIFO fair on the reader side and
it is of course Starvation-free and it does spin-wait, and nine is my
Asym_RWLockX, a lightweight scalable Asymmetric Reader-Writer Mutex that
uses a technic that looks like Seqlock without looping
on the reader side like Seqlock, and this has permited the reader
side to be costless, it is FIFO fair on the writer side and FIFO fair on
the reader side and it is of course Starvation-free and it does not
spin-wait, but waits on my SemaMonitor, so it is energy efficient.
 
If you take a look at the zip file , you will notice that it contains
the DLLs Object pascal source codes, to compile those dynamic link
libraries source codes you will have to download my SemaMonitor Object
pascal source code and my SeqlockX Object pascal source code and my
scalable MLock Object pascal source code and my scalable DRWLock Object
pascal source code from here:
 
https://sites.google.com/site/aminer68/
 
I have compiled and included the 32 bit and 64 bit windows Dynamic Link
libraries inside the zip file, if you want to compile the dynamic link
libraries for Unix and Linux and OSX on (x86) , please download the
source codes of my SemaMonitor and my scalable SeqlockX and my scalable
MLock and my scalable DRWLock and compile them yourself.
 
My SemaMonitor of my C++ synchronization objects library is
easy to use, it 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 a waiting 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.
 
Please read the readme files inside the zip file to know more about them..
 
Language: GNU C++ and Visual C++ and C++Builder
 
Operating Systems: Windows, Linux, Unix and OSX on (x86)
 
 
 
Thank you,
Amine Moulay Ramdane.
Ramine <ramine@1.1>: May 12 10:46AM -0700

Hello,
 
A new algorithm is coming...
 
My previous invention was a scalable Asymmetric Distributed
Reader-Writer Mutex that uses a technic that looks like Seqlock without
looping like Seqlock, and this has permited the reader side to be costless.
 
I am finishing another implementation of a new algorithm of mine,
this one is a scalable Asymmetric Reader-Writer Mutex that is
not distributed, and it uses a technic that looks like Seqlock without
looping like Seqlock, and this has permited the reader side to be
costless, and this one calls the windows FlushProcessWriteBuffers() just
one time, but the my asymmetric distributed algorithm calls
FlushProcessWriteBuffers() many times.
 
 
So stay tuned my new inventions are coming soon...
 
 
 
Thank you,
Amine Moulay Ramdane.
Ramine <ramine@1.1>: May 12 07:19AM -0700

Hello...
 
Here is my new invention that is my new algorithm..
 
I have invented a new algorithm of my scalable Asymmetric Distributed
Reader-Writer Mutex, and this one is costless on the reader side,
this one doesn't use any atomic operations and/or StoreLoad style memory
barriers on the reader side, my new algorithm have
added a technic that looks like Seqlock, but this technic doesn't
loop as Seqlock. Here is my algorithm:
 
On the reader side we have this:
 
--
procedure TRWLOCK.RLock(var myid:integer);
 
var myid1:integer;
id:long;
begin
 
 
myid1:=0;
id:=FCount5^.fcount5;
if (id mod 2)=0
then FCount1^[myid1].fcount1:=1
else FCount1^[myid1].fcount1:=2;
if ((FCount3^.fcount3=0) and (id=FCount5^.fcount5) and
(FCount1^[myid1].fcount1=1))
then
else
begin
LockedExchangeAdd(nbr^.nbr,1);
if FCount1^[myid1].fcount1=2
then LockedExchangeAdd(FCount1^[myid1].fcount1,-2)
else if FCount1^[myid1].fcount1=1
then LockedExchangeAdd(FCount1^[myid1].fcount1,-1);
event2.wait;
LockedExchangeAdd(FCount1^[myid1].fcount1,1);
LockedExchangeAdd(nbr^.nbr,-1);
end;
end;
--
 
 
The writer side will increment FCount5^.fcount5 like does
a Seqlock, and the reader side will grap a copy of FCount5^.fcount5
and copy it on the id variable, if (id modula 2) is equal to zero
that means the writer side has not modified yet Fcount3^.fcount3,
and the reader side will test again if FCount3^.fcount3 equal 0, and
if id=FCount5^.fcount5 didn't change and if FCount1^[myid1].fcount1 that
we have assigned before didn't change and that means that we are
sure that the writer side will block on FCount1^[myid1].fcount1 equal 1.
 
And notice with me that i am not looping like in Seqlock.
 
And the rest of my algorithm is easy to understand.
 
This technic that look like Seqlock without looping like Seqlock
will allow us to be sure that alThough the x86 architecture will reorder
the loads of the inside reader critical section , the loads
inside the reader critical section will not go beyond the load of
FCount5^.fcount5 and this will allow my algorithm to work correctly.
 
My algorithm is FIFO fair on the writer side and FIFO fair on the
Reader side , and of course it is Starvation-free, and it is
suitable for realtime critical systems.
 
I have just updated my C++ synchronization library with
the implementation of my new algorithm..
 
You can download it from:
 
https://sites.google.com/site/aminer68/c-synchronization-objects-library
 
 
You will find the source code of my new algorithm here:
 
https://sites.google.com/site/aminer68/scalable-distributed-reader-writer-mutex
The source
 
 
It is the version 2 that is my own algorithm.
 
 
 
Thank you,
Amine Moulay Ramdane.
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to comp.programming.threads+unsubscribe@googlegroups.com.

No comments: