Changeset 2306 for cobra/trunk/HowTo/370-Threads/500-ThreadPool.cobra
- Timestamp:
- 03/10/10 08:29:43 (2 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
cobra/trunk/HowTo/370-Threads/500-ThreadPool.cobra
r2278 r2306 69 69 _serviced[hc] += 1 70 70 71 Thread.sleep( 2000) # block for 2 seconds71 Thread.sleep(1000) 72 72 Interlocked.increment(inout _count) 73 73 # if all jobs were completed then set the completed event … … 90 90 print 'The number of threads used has been successfully limited' 91 91 92 limit = 300 # max work items to queue so that we can see distribution amongst the threads92 limit = 150 # max work items to queue so that we can see distribution amongst the threads 93 93 completedEvent = ManualResetEvent(false) 94 94 worker = Worker(limit, completedEvent)



