|
|
|
|
Here's an example of a set of unrelated threads:
Notice that the threads are unrelated, even though they have code that is shared. One run of this program produced the following output: COBOL: WE HAVE THE MOST LINES OF CODE! (ALL IN UPPER CASE) COBOL: WE HAVE THE MOST LINES OF CODE! (ALL IN UPPER CASE) C++: Bjarne Stroustrup rules! COBOL: WE HAVE THE MOST LINES OF CODE! (ALL IN UPPER CASE) C++: Bjarne Stroustrup rules! COBOL: WE HAVE THE MOST LINES OF CODE! (ALL IN UPPER CASE) C++: Bjarne Stroustrup rules! COBOL: WE HAVE THE MOST LINES OF CODE! (ALL IN UPPER CASE) C++: Bjarne Stroustrup rules! C++: Bjarne Stroustrup rules! FORTRAN: Can *you* CONTINUE from a DO loop? FORTRAN: Can *you* CONTINUE from a DO loop? FORTRAN: Can *you* CONTINUE from a DO loop? FORTRAN: Can *you* CONTINUE from a DO loop? FORTRAN: Can *you* CONTINUE from a DO loop? Pascal: Niklaus Wirth could teach you a lot! Java: Write once, run (er, test) everywhere! Pascal: Niklaus Wirth could teach you a lot! Java: Write once, run (er, test) everywhere! Pascal: Niklaus Wirth could teach you a lot! Java: Write once, run (er, test) everywhere! Pascal: Niklaus Wirth could teach you a lot! Java: Write once, run (er, test) everywhere! Pascal: Niklaus Wirth could teach you a lot! Java: Write once, run (er, test) everywhere! The output would typically vary from run to run, because of the inherent non-deterministic behavior of multi-threaded programs.
|
| The page was last updated February 19, 2008 |