Could this cause multiple identical GUIDs?

前端 未结 4 1038
耶瑟儿~
耶瑟儿~ 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:24

    No, there is a serial number inside it that changes for each call, so multiple simultaneous calls on different threads on the same system will not create duplicate Guids.

    That does not mean that there is a visible part of the Guid that you can see increments for each call.

提交回复
热议问题