Testing Programs for process concurrency and testing of process concurrency
Here is a small example of interesting process concurrency:
Static void Main (string [] args) {new Thread (WriteX ). start (); new Thread (WriteY ). start (); WriteZ (); Console. readKey ();} static void WriteX () {Console. writeLine ($ "Thread No. X: {Thread. currentThread. managedThreadId} "); for (int I = 0; I <1000; I ++) Console. write ("x");} static void WriteY () {Console. writeLine ($ "Thread No. Y: {Thread. currentThread. managedThreadId} "); for (int I = 0; I <1000; I ++) Console. write ("y");} static void WriteZ () {Console. writeLine ($ "Thread No. Z: {Thread. currentThread. managedThreadId} "); for (int I = 0; I <1000; I ++) Console. write ("z ");}}
A total of three processes are opened, printing X, Y, and Z respectively to view the running results (each time it is random)