This article is rated Start-class on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | ||||||||||||||||||||||||||||
|
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
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
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)
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)
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)
The Java code given here uses AtomicIntArrays, which appears to completely miss the point, since the algorithm doesn't require that any of the operations are atomic. However I don't know Java so I don't know how for sure how to fix it ("IntArray" maybe?) --203.173.240.168 (talk) 02:09, 24 January 2014 (UTC)
I am concerned that the algorithm as shown is not correct because it doesn't handle the overflow case. If the lock is constantly contested, I think the "Number" variable will increase without bound and eventually overflow. Also, I think this can be fixed by making two changes. First when adding 1 to the max, check that the result is not zero (overflow), and if it is then set to 1. Second use sequence number comparisons rather than unsigned magnitude comparison. I.e. (X<Y) becomes ( (signed)(X-Y) < 0 ). A zero value of Number must be handled as a special case. This is a bit tricky, and I am not sure this is correct, so perhaps others can comment. — Preceding unsigned comment added by 216.31.219.19 (talk) 15:15, 4 May 2016 (UTC)