POV-Ray : Newsgroups : povray.off-topic : Lock-free Server Time
29 Jul 2024 04:25:08 EDT (-0400)
  Lock-free (Message 11 to 14 of 14)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Darren New
Subject: Re: Lock-free
Date: 10 Aug 2012 13:37:45
Message: <502546e9@news.povray.org>
On 8/10/2012 0:59, Invisible wrote:
> Why must all algorithms do to with multithreading have food in their names?
>
> First the dining philosophers, and now this?

The dining philosophers introduced "starvation" of resources.

The bakery algorithm is called that because you "take a number" just like at 
the bakery.

-- 
Darren New, San Diego CA, USA (PST)
   "Oh no! We're out of code juice!"
   "Don't panic. There's beans and filters
    in the cabinet."


Post a reply to this message

From: Invisible
Subject: Re: Lock-free
Date: 13 Aug 2012 03:49:27
Message: <5028b187$1@news.povray.org>
On 10/08/2012 06:37 PM, Darren New wrote:

> The bakery algorithm is called that because you "take a number" just
> like at the bakery.

You mean like this?

http://www.cad-comic.com/cad/20100326/

In all seriousness, I've never seen this in any bakery. But the 
supermarkets tend to do it...


Post a reply to this message

From: Invisible
Subject: Re: Lock-free
Date: 15 Aug 2012 07:17:22
Message: <502b8542$1@news.povray.org>
On 10/08/2012 06:37 PM, Darren New wrote:
> The bakery algorithm is called that because you "take a number" just
> like at the bakery.

Maybe I missed it, but... how does the algorithm guarantee that no two 
people take the same number?


Post a reply to this message

From: clipka
Subject: Re: Lock-free
Date: 15 Aug 2012 08:06:33
Message: <502b90c9$1@news.povray.org>
Am 15.08.2012 13:17, schrieb Invisible:
> On 10/08/2012 06:37 PM, Darren New wrote:
>> The bakery algorithm is called that because you "take a number" just
>> like at the bakery.
>
> Maybe I missed it, but... how does the algorithm guarantee that no two
> people take the same number?

It doesn't.

"Due to the limitations of computer architecture, some parts of 
Lamport's analogy need slight modification. It is possible that more 
than one thread will get the same number when they request it; this 
cannot be avoided. Therefore, it is assumed that the thread identifier i 
is also a priority . A lower value of i means a higher priority and 
threads with higher priority will enter the critical section first."

(from Wikipedia, which is one of your friends)


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.