r87929 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87928‎ | r87929 | r87930 >
Date:20:06, 12 May 2011
Author:hashar
Status:ok
Tags:
Comment:
* ammend class comment
* nice spacing
Modified paths:
  • /trunk/phase3/includes/PoolCounter.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/PoolCounter.php
@@ -4,9 +4,14 @@
55 * When you have many workers (threads/servers) giving service, and a
66 * cached item expensive to produce expires, you may get several workers
77 * doing the job at the same time.
 8+ *
89 * Given enough requests and the item expiring fast (non-cacheable,
910 * lots of edits...) that single work can end up unfairly using most (all)
10 - * of the cpu of the pool. This is also known as 'Michael Jackson effect'.
 11+ * of the cpu of the pool. This is also known as 'Michael Jackson effect'
 12+ * since this effect triggered on the english wikipedia on the day Michael
 13+ * Jackson died, the biographical article got hit with several edits per
 14+ * minutes and hundreds of read hits.
 15+ *
1116 * The PoolCounter provides semaphore semantics for restricting the number
1217 * of workers that may be concurrently performing such single task.
1318 *
@@ -16,15 +21,15 @@
1722 abstract class PoolCounter {
1823
1924 /* Return codes */
20 - const LOCKED = 1; /* Lock acquired */
 25+ const LOCKED = 1; /* Lock acquired */
2126 const RELEASED = 2; /* Lock released */
22 - const DONE = 3; /* Another one did the work for you */
 27+ const DONE = 3; /* Another worker did the work for you */
2328
24 - const ERROR = -1; /* Indeterminate error */
25 - const NOT_LOCKED = -2; /* Called release() with no lock held */
26 - const QUEUE_FULL = -3; /* There are already maxqueue workers on this lock */
27 - const TIMEOUT = -4; /* Timeout exceeded */
28 - const LOCK_HELD = -5; /* Cannot acquire another lock while you have one lock held */
 29+ const ERROR = -1; /* Indeterminate error */
 30+ const NOT_LOCKED = -2; /* Called release() with no lock held */
 31+ const QUEUE_FULL = -3; /* There are already maxqueue workers on this lock */
 32+ const TIMEOUT = -4; /* Timeout exceeded */
 33+ const LOCK_HELD = -5; /* Cannot acquire another lock while you have one lock held */
2934
3035 /**
3136 * I want to do this task and I need to do it myself.

Status & tagging log