[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.programming

Here is my new invention that is my new algorithm..

Ramine

5/12/2016 2:19:00 PM

Hello,

Here is my new invention that is my new algorithm..

I have invented a new algorithm of my scalable Asymmetric Distributed
Reader-Writer Mutex, and this one is costless on the reader side,
this one doesn't use any atomic operations and/or StoreLoad style memory
barriers on the reader side, my new algorithm have
added a technic that looks like Seqlock, but this technic doesn't
loop as Seqlock. Here is my algorithm:

On the reader side we have this:

--
procedure TRWLOCK.RLock(var myid:integer);

var myid1:integer;
id:long;
begin


myid1:=0;
id:=FCount5^.fcount5;
if (id mod 2)=0
then FCount1^[myid1].fcount1:=1
else FCount1^[myid1].fcount1:=2;
if ((FCount3^.fcount3=0) and (id=FCount5^.fcount5) and
(FCount1^[myid1].fcount1=1))
then
else
begin
LockedExchangeAdd(nbr^.nbr,1);
if FCount1^[myid1].fcount1=2
then LockedExchangeAdd(FCount1^[myid1].fcount1,-2)
else if FCount1^[myid1].fcount1=1
then LockedExchangeAdd(FCount1^[myid1].fcount1,-1);
event2.wait;
LockedExchangeAdd(FCount1^[myid1].fcount1,1);
LockedExchangeAdd(nbr^.nbr,-1);
end;
end;
--


The writer side will increment FCount5^.fcount5 like does
a Seqlock, and the reader side will grap a copy of FCount5^.fcount5
and copy it on the id variable, if (id modula 2) is equal to zero
that means the writer side has not modified yet Fcount3^.fcount3,
and the reader side will test again if FCount3^.fcount3 equal 0, and
if id=FCount5^.fcount5 didn't change and if FCount1^[myid1].fcount1 that
we have assigned before didn't change and that means that we are
sure that the writer side will block on FCount1^[myid1].fcount1 equal 1.

And notice with me that i am not looping like in Seqlock.

And the rest of my algorithm is easy to understand.

This technic that look like Seqlock without looping like Seqlock
will allow us to be sure that alThough the x86 architecture will reorder
the loads of the inside reader critical section , the loads
inside the reader critical section will not go beyond the load of
FCount5^.fcount5 and this will allow my algorithm to work correctly.

My algorithm is FIFO fair on the writer side and FIFO fair on the
Reader side , and of course it is Starvation-free, and it is
suitable for realtime critical systems.

I have just updated my C++ synchronization library with
the implementation of my new algorithm..

You can download it from:

https://sites.google.com/site/aminer68/c-synchronization-objec...


You will find the source code of my new algorithm here:

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


It is the version 2 that is my own algorithm.



Thank you,
Amine Moulay Ramdane.










7 Answers

SlackJaw

9/19/2008 11:38:00 PM

0

Mitchell Holman wrote:

> Poetic Justice <@http://Poetic-Justice.Talk-n-D... wrote in
> news:gKPyk.31759$bx1.3730@bignews1.bellsouth.net:
>
> > Sid9 wrote:
> >> "glw82664" <glw82664@hotmail.com> wrote in message
> >>
> news:7cc2f826-32d7-46e3-8755-f62ed3028220@z72g2000hsb.googlegroups.com
> ... >>> On Sep 13, 9:33 am, Mitchell Holman <Noem...@comcast.com>
> wrote: >>>> "Delete C: *.*" <"Delete C: *.*"@talk-n-dog..com> wrote
> in >>>> news:UTOyk.31735 >>>> $bx1.9...@bignews1.bellsouth.net:
> > > > >
> >>>>> Poetic Justice wrote:
> >>>>>> ZNUYBV wrote:
> >>>>>>> On Sep 11, 6:28 am, Mitchell Holman <Noem...@comcast.com>
> wrote: >>>>>>>> "Poor Lil Johnny" <t...@alas.net> wrote
> >>>>>>>> innews:MQ8yk.19793$LG4.7271@nlpi065.nbdc.sbc.com:
> >>>>>>>>> Actor Matt Damon Condemns Palin for Sheer Lack of Experience
> >>>>>> And we care because.....
> >>>>> .... because Matt Damon made a move where he played a
> government worker >>>>> and so he knows government?
> >>>> But Palin knows all about foreign policy since her state
> >>>> is next to Russia.
> > > >
> >>> Yet, somehow a couple years as governor or arkansas made bill
> clinton >>> completely qualified to deal with foreign policy.
> >>
> >>
> >> Clinton had studied in Great Britain and is a lot smarter than
> either >> McCain, bush,jr, Palin, or Cheney
> >>
> >>
> > Define smarter?
>
>
> Which of the above is the Rhodes scholar and former law professor?

Not the one with the MBA from Havard.

--
-
"I made the decision not to use my show as a platform for any of the
candidates." -Oprah explaining why she would not have Sarah Palin on
her show, after she aleady had Obama on twice.

SlackJaw

9/19/2008 11:38:00 PM

0

Sid9 wrote:

>
>
> "Poetic Justice" <@http://Poetic-Justice.Talk-n-D... wrote in
> message news:VNRyk.31824$bx1.15186@bignews1.bellsouth.net...
> > Mitchell Holman wrote:
> >> Poetic Justice <@http://Poetic-Justice.Talk-n-D... wrote in
> >> news:gKPyk.31759$bx1.3730@bignews1.bellsouth.net:
> > >
> >>> Sid9 wrote:
> >>>> "glw82664" <glw82664@hotmail.com> wrote in message
> >>>>
> news:7cc2f826-32d7-46e3-8755-f62ed3028220@z72g2000hsb.googlegroups.com
> ... >>>>> On Sep 13, 9:33 am, Mitchell Holman <Noem...@comcast.com>
> wrote: >>>>>> "Delete C: *.*" <"Delete C: *.*"@talk-n-dog..com>
> wrote in >>>>>> news:UTOyk.31735 >>>>>>
> $bx1.9...@bignews1.bellsouth.net:
> > > > > > >
> >>>>>>> Poetic Justice wrote:
> >>>>>>>> ZNUYBV wrote:
> >>>>>>>>> On Sep 11, 6:28 am, Mitchell Holman <Noem...@comcast.com>
> wrote: >>>>>>>>>> "Poor Lil Johnny" <t...@alas.net> wrote
> >>>>>>>>>> innews:MQ8yk.19793$LG4.7271@nlpi065.nbdc.sbc.com:
> >>>>>>>>>>> Actor Matt Damon Condemns Palin for Sheer Lack of
> Experience >>>>>>>> And we care because.....
> >>>>>>> .... because Matt Damon made a move where he played a
> government >>>>>>> worker
> >>>>>>> and so he knows government?
> >>>>>> But Palin knows all about foreign policy since her state
> >>>>>> is next to Russia.
> >>>>> Yet, somehow a couple years as governor or arkansas made bill
> clinton >>>>> completely qualified to deal with foreign policy.
> > > > >
> >>>> Clinton had studied in Great Britain and is a lot smarter than
> either >>>> McCain, bush,jr, Palin, or Cheney
> > > > >
> >>> Define smarter?
> > >
> > >
> >> Which of the above is the Rhodes scholar and former law
> professor?
> >
> > That's "educated" not smarter.
>
> Neither Palin nor McCain qualifies as "smart"
>
> Both are like dumb loud mouths at PTA meetings

As compared to you, Sid?

--
-
"I made the decision not to use my show as a platform for any of the
candidates." -Oprah explaining why she would not have Sarah Palin on
her show, after she aleady had Obama on twice.

Mitchell Holman

9/20/2008 1:57:00 AM

0

"SlackJaw" <SlackJaw@Hotmail.com> wrote in
news:Se6dnU1TutFdqknVnZ2dnUVZ_rvinZ2d@comcast.com:

> Mitchell Holman wrote:
>
>> Poetic Justice <@http://Poetic-Justice.Talk-n-D... wrote in
>> news:gKPyk.31759$bx1.3730@bignews1.bellsouth.net:
>>
>> > Sid9 wrote:
>> >> "glw82664" <glw82664@hotmail.com> wrote in message
>> >>
>> news:7cc2f826-32d7-46e3-8755-f62ed3028220@z72g2000hsb.googlegroups.com
>> ... >>> On Sep 13, 9:33 am, Mitchell Holman <Noem...@comcast.com>
>> wrote: >>>> "Delete C: *.*" <"Delete C: *.*"@talk-n-dog..com> wrote
>> in >>>> news:UTOyk.31735 >>>> $bx1.9...@bignews1.bellsouth.net:
>> > > > >
>> >>>>> Poetic Justice wrote:
>> >>>>>> ZNUYBV wrote:
>> >>>>>>> On Sep 11, 6:28 am, Mitchell Holman <Noem...@comcast.com>
>> wrote: >>>>>>>> "Poor Lil Johnny" <t...@alas.net> wrote
>> >>>>>>>> innews:MQ8yk.19793$LG4.7271@nlpi065.nbdc.sbc.com:
>> >>>>>>>>> Actor Matt Damon Condemns Palin for Sheer Lack of Experience
>> >>>>>> And we care because.....
>> >>>>> .... because Matt Damon made a move where he played a
>> government worker >>>>> and so he knows government?
>> >>>> But Palin knows all about foreign policy since her state
>> >>>> is next to Russia.
>> > > >
>> >>> Yet, somehow a couple years as governor or arkansas made bill
>> clinton >>> completely qualified to deal with foreign policy.
>> >>
>> >>
>> >> Clinton had studied in Great Britain and is a lot smarter than
>> either >> McCain, bush,jr, Palin, or Cheney
>> >>
>> >>
>> > Define smarter?
>>
>>
>> Which of the above is the Rhodes scholar and former law professor?
>
> Not the one with the MBA from Havard.


Can you spell "Legacy Admission"?






"I want you to know that farmers are not going to
be secondary thoughts to a Bush administration. They
will be in the forethought of our thinking."
George Bush, Salinas, Calif., Aug. 10, 2000



"Will the highways on the Internet become more few?"
George W Bush, Concord, N.H., Jan. 29, 2000


"We cannot let terrorists and rogue nations hold
this nation hostile or hold our allies hostile.''
George Bush, Aug 21, 2000



"I think we agree, the past is over."
--George Bush, May 10, 2000



"I know how hard it is for you to put food on your family."
George W Bush, Jan. 27, 2000


"Our enemies are innovative and resourceful, and so
are we. They never stop thinking about ways to harm
our country and our people and neither do we."
George Bush, Aug 5 2004


"You teach a child to read and he or
her will be able to pass a literacy test."
George Bush, February 21, 2001 -









SlackJaw

9/20/2008 8:29:00 PM

0

Mitchell Holman wrote:

> >> Which of the above is the Rhodes scholar and former law
> professor?
> >
> > Not the one with the MBA from Havard.
>
>
> Can you spell "Legacy Admission"?

Mitch, do you even know what a "Legacy Admission" is?

--
-
"I made the decision not to use my show as a platform for any of the
candidates." -Oprah explaining why she would not have Sarah Palin on
her show, after she aleady had Obama on twice.

Nicklas

9/20/2008 11:48:00 PM

0

On Sat, 20 Sep 2008 15:29:10 -0500, "SlackJaw"
<SlackJaw@Hotmail.com> wrote:

>Mitch, do you even know what a "Legacy Admission" is?
>
Something found on your bed-sheets in the morning after
your boyfriend leaves, I think.

Poetic Justice

9/21/2008 12:32:00 AM

0

Nicklas@Click.com wrote:
> On Sat, 20 Sep 2008 15:29:10 -0500, "SlackJaw"
> <SlackJaw@Hotmail.com> wrote:
>
>> Mitch, do you even know what a "Legacy Admission" is?
>>
> Something found on your bed-sheets in the morning after
> your boyfriend leaves, I think.

He can't get a boy friend or a girl friend, just yesterday he was late
to work, he woke up and he was stuck to his sheets.

SlackJaw

9/21/2008 6:07:00 PM

0

SlackJaw wrote:

> Mitchell Holman wrote:
>
> > >> Which of the above is the Rhodes scholar and former law
> > professor?
> > >
> > > Not the one with the MBA from Havard.
> >
> >
> > Can you spell "Legacy Admission"?
>
> Mitch, do you even know what a "Legacy Admission" is?

I didn't think so...

--
-
"I made the decision not to use my show as a platform for any of the
candidates." -Oprah explaining why she would not have Sarah Palin on
her show, after she aleady had Obama on twice.