Ticket #37 (reopened defect)
GCD queue overflowed?
| Reported by: | victor.tsang@… | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | MacOSX |
| Version: | 1.0 | Keywords: | |
| Cc: |
Description
I found that the queue may overflow and lost some task blocks.
As attached, my test program is to create a block to submit lots of tasks into concurrent queue. The task is just do something eating up CPU and then queue a finishing task into a serial queue. The finishing task is to decrement a count and that that should go down to zero if everything is correct.
However, if the number of tasks is big(?), such as 100,000 or 1,000,000, the count cannot go back to zero... it looks like that some tasks are missed. As dispatch_async() is a void function, the program cannot get the queue overflow information and perform retry or any other error correction.
I tested the code in both
1. MacBookPro? i7 4-core CPU, Lion, with clang3.0 / Xcode 4.2.1
2. the same Lion machine under Parallels VM with 4-core CPU, FreeBSD 8.2 with clang3.0.


