More about me as an inventor of many scalable algorithms..
(trop ancien pour répondre)
2020-05-22 21:34:24 UTC

More about me as an inventor of many scalable algorithms..

I am a white arab and i think i am like a genius, because i have
invented many scalable algorithms and there implementations, and look
for example at my just new invention of a scalable algorithm here:


As you have noticed, you have to be like a genius to be able to invent
my above scalable algorithm of a scalable RWLock, because it has the
following characteristics:

1- It is Scalable
2- It is Starvation-free
3- It is fair
4- It can be used across processes and threads
5- It can be used as a scalable Lock across processes and threads
by using my scalable AMLock on the writers side, or it can be
used as a scalable RWLock.

I am using my scalable Lock that is called scalable AMLock on the
writers side.

Here is why scalable Locks are really important:


So all in all it is a really good invention of mine.

Read my previous thoughts:

Here is how to use my new invention that is my scalable RWLock
across processes:

Just create an scalable rwlock object by giving a name in one process by
calling the constructor like this:


And you can use the scalable rwlock object from another process by
calling the constructor by using the name like this:


So as you are noticing i have abstracted it efficiently..

Read the rest of my previous thoughts:

My new invention of a Scalable RWLock that works across processes and
threads is here, and now it works on both Windows and Linux..

Please download my source code and take a look at how i am making it
work across processes by using FNV1a hash on both process ID and thread
ID, FNV1a has a good dispersion, and FNV1a hash permits also my RWLock
to be scalable.

You can download it from my website here:



This is my invention of a fast, and scalable and starvation-free and
fair and lightweight Multiple-Readers-Exclusive-Writer Lock called
LW_RWLockX, it works across processes and threads.

The parameters of the constructor are: first parameter is the name of
the scalable RWLock to be used across processes, if the name is empty,
it will only be used across threads. The second parameter is the size of
the array of the readers, so if the size of the array is equal to the
number of parallel readers, so it will be scalable, but if the number of
readers are greater than the size of the array , you will start to have
contention. The third parameter is the size of the array of my scalable
Lock that is called AMLock, the number of threads can go beyond the size
of the array of the scalable AMLock, please look at the source code of
my scalable algorithms to understand.

I have also used my following implementation of FNV1a hash function to
make my new variants of RWLocks scalable (since FNV1a is a hash
algorithm that has good dispersion):

function FNV1aHash(key:int64): UInt64;

i: Integer;


FNV_offset_basis: UInt64 = 14695981039346656037;
FNV_prime: UInt64 = 1099511628211;


//FNV-1a hash

Result := FNV_offset_basis;

for i := 1 to 8 do
key1:=(key shr ((i-1)*8)) and $00000000000000ff;
Result := (Result xor key1) * FNV_prime;


- Platform: Windows, Unix and Linux on x86

Required FPC switches: -O3 -Sd

-Sd for delphi mode....

Required Delphi switches: -$H+ -DDelphi

For Delphi XE-XE7 and Delphi tokyo use the -DXE switch

You can configure it as follows from inside defines.inc file:

{$DEFINE CPU32} and {$DEFINE Windows32} for 32 bit systems
{$DEFINE CPU64} and {$DEFINE Windows64} for 64 bit systems

Thank you,
Amine Moulay Ramdane.
2020-05-22 22:03:34 UTC
Le 22/05/2020 à 23:34, Wisdom90 a écrit :
Post by Wisdom90
Thank you,
Amine Moulay Ramdane.
So what ? What you want exactly ? :o)



Post by Wisdom90
Macron, je veux bien marcher dessus du pied gauche, ça porte bonheur.
Et voilà. J'étais sûr que ça allait déraper...
Forcément, ça glisse.