Is memcpy process-safe?

前端 未结 4 1078
执笔经年
执笔经年 2020-12-16 03:54

Ive looked online and have not been able to satisfy myself with an answer.

Is memcpy threadsafe? (in Windows)

What I mean is if I write to an area of memory

4条回答
  •  独厮守ぢ
    2020-12-16 04:11

    Routines like memcpy() (or memmove()) are part of standard C library, are included through standard header and know nothing about any locking mechanics. Locking should be provided by some external way like inter-process mutexes, semaphores or things like this.

提交回复
热议问题