[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.programming

The standard deviation of the throughput of the scalable Locks

Ramine

11/2/2014 6:34:00 PM

Hello,


What i have done correctly is that i have lowered the
standard deviation of the throughtput of my scalable MLock
(it is a scalable lock)... what do i mean by that ?
you have to be careful when you are using Ticket spinlock
with a proportional backoff , cause when there is many more threads
contending for the Lock, the threads that didn't yet received
there ticket to enter and that are scheduled to run , will use all
there quantum time(time slice), so they will slow the throughput by much
and they will genrate a bigger standard deviation on there
thoughtput..so what you have to do is use for example a windows sleep(0)
after the proportional backoff to give up the time slice as soon as
possible and this will lower by much the standard deviation of the
thoughput of the Ticket spinlock with a propotional backoff... i have
used the same technic for my scalable MLock and it is giving a much
smaller standard deviation for its throughput...and this has solved the
same problem on my SemaMonitor and SemaCondvar , using my technic
allowed the standard deviation of there throughput to be lowered a
lot... so you have to be smart please and make sure you avoid those
problems...


Here is the source code that i am using to lower the standard deviation
of the throughput of my scalable MLock, and it is working
perfectly...

--

inc(k);
if (k mod 140)=0
then
{$IFDEF FPC}
ThreadSwitch;
{$ENDIF}
{$IFDEF Delphi}
sleep(0);
{$ENDIF}

-




Thank you,
Amine Moulay Ramdane.