[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.programming

We have to be smart...

Ramine

3/17/2015 1:52:00 AM


Hello,


We have to be smart, i have come to an interresting subject...

As i have told you before, my SeqlockX is a Seqlock variant that
has eliminated the livelock of the readers when there is many writers,
but as you know you can not use datastructures that use pointers
with Seqlock, so how can we elevate this problem ? this is
an interresting subject, because the Dmitry's Distributed Reader-Writer
mutex is using an atomic lock that uses an mfence , so it is expensive,
so how can i elevate this problem without using RCU ? so i have
tried to reread my AVL sequential algorithm especially in the
FindSuccessor() method that is used for the iterator and the FindKey()
method... so i don't think there is a problem with those methods if they
are used with my SeqlockX , the only problem is when there is
an access violation exception, and this exception will be catched
in Delphi and FreePascal with the following code:

try

// your reader section here

except
On E : EAccessViolation do;
else
raise;
end;


So i think we can safetly use my SeqlockX with an AVL tree
algorithm to render the AVL tree a fast and concurrent AVL tree..
i don't think that there is a problem with a Skiplist either,
because look at the search() function inside the Skiplist algorithm:

function search(l : list; key : keyType; var value : valueType) : boolean;
var k : integer;
p,q : node;
begin
p := l^.header;
for k:= l^.level downto 1 do begin
q := p^.fwd[k];
while q^.key < key do begin
p := q;
q := p^.fwd[k];
end;
end;
if (q^.key <> key) then search := false
else begin
value := q^.value;
search := true;
end;
end;


If k generates an access violation this will be catched inside the
SeqlockX reader section, that's the same for q^.value or q^.key, other
than that i don't think there is a problem... so no need to use RCU,
my SeqlockX will works just fine with AVL tree and Red Black tree and
with Skiplists and with link lists..




Thank you,
Amine Moulay Ramdane.