Short Answer
Possible (as in, could it ever happen, in the lifetime of the universe)? Yes.
Likely (at all)? No.
Longer Answer
Microsoft utilizes a Version 4 algorithm for generating GUIDs (see also: here), which produces a completely (pseudo-)random number.
Given the number of possible GUIDs, the probability of a duplicate is tiny. Like, unfathomably tiny.
You are concerned with concurrency: fortunately, the NewGuid
method is thread-safe, which means it either locks or utilizes a thread-static random number generator for its purposes. The first approach would effectively serialize all calls to NewGuid
so that they occur in sequence (never simultaneously) while the latter would make calls from separate threads independent of one another.
In either case, the only reason you would have to fear getting duplicates from two threads creating random numbers simultaneously -- GUID
or not -- would be if the underlying generators used by the threads were operating (1) from the same seed (which could only result from a design flaw), and (2) in a time-dependent manner (which the version 4 GUID algorithm does not).
So yes, practically speaking, you can treat GUIDs generated concurrently from separate threads to be unique.