-
-
Notifications
You must be signed in to change notification settings - Fork 940
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7b2b39b
commit a9f5c1d
Showing
1 changed file
with
4 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is not acceptable, it's faking the timer to get to a desired result.
This entire testcase is wrong and prone to race conditions. It starts up to 20 threads, and then starts measuring time. But it fails to account for the time it takes to start the threads; by the time the last thread is started, the first one might have already completed (or be almost complete), so the 30ms timeout may in fact be a sufficient delay for the event to be signaled. The 20 thread execution will also depend on whether this runs on a 4/8/16/32 core machine - the 32-core machine can start the 20 threads much faster than the 4-core one.
Also, what exactly is this test testing? I would just throw it away if it's just testing .Net intrinsics.