To create a program that starts two new threads, and then two more threads inside those threads, you need to use the System.Threading
namespace in C#.
main.cs762 chars36 lines
In this code, we create two threads t1
and t2
. Each of these threads starts another thread inside them, t3
and t4
. When the program is run, it will output the following:
main.cs68 chars5 lines
This shows that both the first and second threads started successfully, and that both the third and fourth threads were started inside those threads.
gistlibby LogSnag