Could this cause multiple identical GUIDs?

前端 未结 4 1000
耶瑟儿~
耶瑟儿~ 2021-01-17 19:32

As GUID generation is time-dependent, if System.Guid.NewGuid() is called multiple times at the exact same instant on different threads, could it return identical GUIDs?

4条回答
  •  有刺的猬
    2021-01-17 20:16

    Unless your threads are running on different cores on your machine, only one thread will be actually running at a given time. Hence, I do not think it is very likely that calls to NewGuid() will take place at the exact same time.

提交回复
热议问题