[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.programming

To be more precise...

aminer

4/12/2014 3:15:00 AM


Hello,


We have to be smart please, as you have noticed i have
wrote another scalable FIFO fair lock and i have
studied deeply , and i have come to the conclusion
that it's useful to learn and useful to use, i have
began to test it under contention to see how it behave,
under contention with 2 threads on a Quadcore and
under contention with 4 threads, what i have
discovered that under contention with two threads
the following section in the Enter() method
will be accessed by 1/2 of the total number of threads

here is the section, it is when PMyRecord4(a)^.count equal -1:

if PMyRecord4(a)^.myid=0
then
begin
PMyRecord4(a)^.count:=1;
exit;
end
else
begin
freemem(PMyRecord4(a)^.mem); <- this one
end;
end

but under contention with 4 threads this same section
will be accessed almost 0 times.. so if you want to test
the scalability with two threads scenario under contention,
you will not be able to do it accuratly cause under contention
with two threads the queue.pop(tobject(a)) statement inside the Enter()
method will be cheap compared to the 4 threads scenario under
contention, but what i can tell you for sure is that with 4 threads and
more and with more cores and under contention my FIFO fair lock
will be scalable.

But we have to be smart more than that, you will say that my
scalable FIFO fair lock is slower by almost 2x times than the
Ticket spinlock with a proportional backoff, but you have
to understand that the TicketSpinlock will not scale with
bigger critical sections , my scalable FIFO fair lock
will, other than that you have to understand that as the time
inside the critical section becomes bigger the speed
of my scalable FIFO fair lock will be almost equal to that of
the TicketSpinlock with a proportional backoff, other than
that, to make my scalable FIFO fair lock faster you can use
a Waitfree FIFO queue on the pop side of the queue.

You can download my scalable FIFO fair lock from:

http://pages.videotron.c...




Thank you,
Amine Moulay Ramdane.






















1 Answer

aminer

4/12/2014 3:18:00 AM

0

On 4/11/2014 8:14 PM, aminer wrote:
>
> Hello,
>
>
> We have to be smart please, as you have noticed i have
> wrote another scalable FIFO fair lock and i have
> studied deeply , and i have come to the conclusion
> that it's useful to learn and useful to use, i have
> began to test it under contention to see how it behave,
> under contention with 2 threads on a Quadcore and
> under contention with 4 threads, what i have
> discovered that under contention with two threads
> the following section in the Enter() method
> will be accessed by 1/2 of the total number of threads

I mean 1/2 the total number of times the threads enter the Enter()
method.


>
> here is the section, it is when PMyRecord4(a)^.count equal -1:
>
> if PMyRecord4(a)^.myid=0
> then
> begin
> PMyRecord4(a)^.count:=1;
> exit;
> end
> else
> begin
> freemem(PMyRecord4(a)^.mem); <- this one
> end;
> end
>
> but under contention with 4 threads this same section
> will be accessed almost 0 times.. so if you want to test
> the scalability with two threads scenario under contention,
> you will not be able to do it accuratly cause under contention
> with two threads the queue.pop(tobject(a)) statement inside the Enter()
> method will be cheap compared to the 4 threads scenario under
> contention, but what i can tell you for sure is that with 4 threads and
> more and with more cores and under contention my FIFO fair lock
> will be scalable.
>
> But we have to be smart more than that, you will say that my
> scalable FIFO fair lock is slower by almost 2x times than the
> Ticket spinlock with a proportional backoff, but you have
> to understand that the TicketSpinlock will not scale with
> bigger critical sections , my scalable FIFO fair lock
> will, other than that you have to understand that as the time
> inside the critical section becomes bigger the speed
> of my scalable FIFO fair lock will be almost equal to that of
> the TicketSpinlock with a proportional backoff, other than
> that, to make my scalable FIFO fair lock faster you can use
> a Waitfree FIFO queue on the pop side of the queue.
>
> You can download my scalable FIFO fair lock from:
>
> http://pages.videotron.c...
>
>
>
>
> Thank you,
> Amine Moulay Ramdane.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>