Why does the main thread's output come first in C#?

前端 未结 7 2188
半阙折子戏
半阙折子戏 2021-02-04 23:41

I wrote this little program:

class Program
{
    static void Main(string[] args)
    {
        Thread t = new Thread(WriteX);
        t.Start();

        for (in         


        
7条回答
  •  遥遥无期
    2021-02-05 00:12

    Your code is non deterministic. Your code contains no thread primitives that would schedule priority of one thread over another or for one thread to wait for another.

提交回复
热议问题