-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2009-09-05 Zoltan Varga <vargaz@gmail.com>
* process-stress.cs: New stress test for spawning processes. svn path=/trunk/mono/; revision=141380
- Loading branch information
Showing
3 changed files
with
38 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 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 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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,32 @@ | |||
using System; | |||
using System.Diagnostics; | |||
|
|||
public class Tests | |||
{ | |||
static int iterations = 512; | |||
|
|||
public static void Main(string[] args) { | |||
if (args.Length > 0) | |||
iterations = Int32.Parse (args [0]); | |||
|
|||
// Spawn threads without waiting for them to exit | |||
for (int i = 0; i < iterations; i++) { | |||
Console.Write ("."); | |||
//Console.WriteLine("Starting: " + i.ToString()); | |||
using (var p = System.Diagnostics.Process.Start("echo -n")) { | |||
System.Threading.Thread.Sleep(10); | |||
} | |||
} | |||
|
|||
// Spawn threads and wait for them to exit | |||
for (int i = 0; i < iterations; i++) { | |||
Console.Write ("."); | |||
//Console.WriteLine("Starting: " + i.ToString()); | |||
using (var p = System.Diagnostics.Process.Start("echo -n")) { | |||
p.WaitForExit (); | |||
} | |||
} | |||
|
|||
Console.WriteLine (); | |||
} | |||
} |