I'm curious to know if a thread running memcpy gets preempted by other threads while memcpy is in progress?.
If yes, what would happen to the copy in progress?. How's it handled internally?.
I'm curious to know if a thread running memcpy gets preempted by other threads while memcpy is in progress?.
If yes, what would happen to the copy in progress?. How's it handled internally?.
As with nearly every function in the C++ standard library, memcpy
is not defined in terms of what its state might be after it has been called, but before it has returned.
Any attempt by a thread to access data that memcpy
is in the process of writing to is, by definition, a race condition.