Jump to content

Talk:Lamport's bakery algorithm

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 204.176.49.46 (talk) at 18:18, 16 January 2012 (Further comments). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
WikiProject iconComputing Start‑class
WikiProject iconThis article is within the scope of WikiProject Computing, a collaborative effort to improve the coverage of computers, computing, and information technology on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
StartThis article has been rated as Start-class on Wikipedia's content assessment scale.
???This article has not yet received a rating on the project's importance scale.
WikiProject iconComputer science Start‑class Mid‑importance
WikiProject iconThis article is within the scope of WikiProject Computer science, a collaborative effort to improve the coverage of Computer science related articles on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
StartThis article has been rated as Start-class on Wikipedia's content assessment scale.
MidThis article has been rated as Mid-importance on the project's importance scale.
Things you can help WikiProject Computer science with:

It's, of course, of no theoretical import ... but might it seem a bit more natural to computer scientists to index the array from [0..N-1]? This follows more closely how many programming languages work.

I agree so that we maintain consistency. JWHPryor 15:45, 22 December 2006 (UTC)JWHPryor[reply]

I think the "critical section" and "non-critical section" should be moved out of the article as they apply to all concurrency articles. There should just be a link. JWHPryor 15:45, 22 December 2006 (UTC)JWHPryor[reply]

I disagree. It's handy to have a quick summary to refresh your memory in addition to a link to the main section for further details. 67.6.222.36 (talk) 22:52, 24 June 2011 (UTC)[reply]

The "pseudocode" isn't pseudocode at all: it's full of semicolons, brackets, and language-specifics. Pseudocode should read like English. 86.150.130.12 22:59, 3 January 2007 (UTC)[reply]

I disagree. "Pseudocode" says what it's not, not what it is. The point is that it uses common conventions that most people will understand. Brackets are quite common for arrays. Semi's help to delineate instructions. If you remove all the "shorthand" symbols to make it read more like Engish, then it gets too wordy and starts to get ambiguous. 67.6.222.36 (talk) 22:52, 24 June 2011 (UTC)[reply]

The following is incorrect: "It is possible that more than one thread will get the same number when they request it; this cannot be avoided." With an atomic increment instruction each thread is guaranteed a unique ticket.--C0d1f1ed (talk) 06:15, 21 April 2008 (UTC)[reply]

They mean when no such primitives are available. If you have various "atomic" operations, this whole thing is unnecessary. I agree though that variations of this idea can be present in "lock free code" that avoids expensive instructions but still uses them when necessary. Długosz (talk) 18:51, 23 September 2009 (UTC)[reply]
True. This is an algorithm for when atomic operations are no available. 67.6.222.36 (talk) 22:52, 24 June 2011 (UTC)[reply]

I would like to suggest that using the syntax (a, b) < (c, d) is unnecessary and confusing; it is not, as far as I know, standard syntax in any language, and it is used in only one place within the pseudocode where the expanded form (a < c) || ((a == c) && (b < d)) is nearly as compact. Why not just use the standard syntax which is more understandable and will not expand the size of the pseudocode significantly? Eliminating this nonstandard syntax will also shorten the Wikipedia article as it will not be necessary to have the explanatory section for this syntax. — Preceding unsigned comment added by 204.176.49.46 (talk) 17:54, 16 January 2012 (UTC)[reply]

I'd like to add that I have just read Lamport's original paper and the (a, b) < (c, d) syntax is lifted directly from that paper. I can see why there was some interest in using that syntax here since it reflects Lamport's original language; but I think my point still holds: it is unnecessary, and this article would be better if it were eliminated.