Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming.threads > #1875

Enhanced scalable Anderson Lock...

From aminer <aminer@toto.net>
Newsgroups comp.programming.threads
Subject Enhanced scalable Anderson Lock...
Date 2013-10-09 11:59 -0700
Organization albasani.net
Message-ID <l3492l$r57$1@news.albasani.net> (permalink)

Show all headers | View raw


Hello,

I have updated my enhanced scalable Anderson Lock ,
i have corrected a bugin the enter() method

here is the what i have corrected:

==
procedure TALOCK.Enter;

var  count1,slot:long;

begin

repeat

count1:=LockedIncInt(count);

if count1<= FSize then break;

LockedDecInt(count);

while count>=fsize // <-- i have changed here count1 by count
do sleep(0);

sleep(0);

until false;

slot:=LockedIncInt(fcount2^.fcount2);
while Fcount1^[(slot-1) mod fsize].fcount1<>1
do sleep(0);
end;

===


Other than that if you have noticed the following

while count>=fsize
do sleep(0);

is important so that the Enter() method do not deadlock
if the threads increment count beyong fsize...


You can download my enhanced scalable Anderson Lock from:

http://pages.videotron.com/aminer/


Thank you,
Amine Moulay Ramdane



Back to comp.programming.threads | Previous | Next | Find similar


Thread

Enhanced scalable Anderson Lock... aminer <aminer@toto.net> - 2013-10-09 11:59 -0700

csiph-web