[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.programming

About my SeqllockX...

Ramine

3/17/2015 12:15:00 AM


Hello,


Today i will speak about my SeqlockX that is a variant of the classical
Seqlock that eliminates livelock of the readers when there is many writer.

You will read on internet that Seqlock doesn't work with datastructures
that work with "pointers", because when you use the reader section
in an optimistic way, if the writers modify some pointers , you can get
an "exception", so since it is an exception what can we do about it ?
in Delphi and FreePascal you can catch this exception called
"EAccessViolation" inside the reader section like this:

try

// your reader section here

except
// IO error
On E : EAccessViolation do;
else
raise;
end;


So this way you can effectively use my SeqlockX with datastructures that
uses pointers.



Thank you,
Amine Moulay Ramdane.
2 Answers

Ramine

3/17/2015 12:56:00 AM

0


Hello,


I think this will work with a linklist and with a SkipList,
i am not sure for AVL trees and Red-Black trees...



Thank you,
Amine Moulay Ramdane.



On 3/16/2015 5:15 PM, Ramine wrote:
>
> Hello,
>
>
> Today i will speak about my SeqlockX that is a variant of the classical
> Seqlock that eliminates livelock of the readers when there is many writer.
>
> You will read on internet that Seqlock doesn't work with datastructures
> that work with "pointers", because when you use the reader section
> in an optimistic way, if the writers modify some pointers , you can get
> an "exception", so since it is an exception what can we do about it ?
> in Delphi and FreePascal you can catch this exception called
> "EAccessViolation" inside the reader section like this:
>
> try
>
> // your reader section here
>
> except
> // IO error
> On E : EAccessViolation do;
> else
> raise;
> end;
>
>
> So this way you can effectively use my SeqlockX with datastructures that
> uses pointers.
>
>
>
> Thank you,
> Amine Moulay Ramdane.

Ramine

3/17/2015 1:04:00 AM

0

Hello,


Forget my method , i think it's not good...


If you are using a read-mostly datastructure with pointers don't use
Seqlock, please use instead the Scalable Distributed Reader-Writer Mutex
here:


https://sites.google.com/site/aminer68/scalable-distributed-reader-wr...


Thank you,
Amine Moulay Ramdane.





On 3/16/2015 5:56 PM, Ramine wrote:
>
> Hello,
>
>
> I think this will work with a linklist and with a SkipList,
> i am not sure for AVL trees and Red-Black trees...
>
>
>
> Thank you,
> Amine Moulay Ramdane.
>
>
>
> On 3/16/2015 5:15 PM, Ramine wrote:
>>
>> Hello,
>>
>>
>> Today i will speak about my SeqlockX that is a variant of the classical
>> Seqlock that eliminates livelock of the readers when there is many
>> writer.
>>
>> You will read on internet that Seqlock doesn't work with datastructures
>> that work with "pointers", because when you use the reader section
>> in an optimistic way, if the writers modify some pointers , you can get
>> an "exception", so since it is an exception what can we do about it ?
>> in Delphi and FreePascal you can catch this exception called
>> "EAccessViolation" inside the reader section like this:
>>
>> try
>>
>> // your reader section here
>>
>> except
>> // IO error
>> On E : EAccessViolation do;
>> else
>> raise;
>> end;
>>
>>
>> So this way you can effectively use my SeqlockX with datastructures that
>> uses pointers.
>>
>>
>>
>> Thank you,
>> Amine Moulay Ramdane.
>