Thread-safe C++ stack

后端 未结 6 1376
余生分开走
余生分开走 2021-01-30 18:56

I\'m new to C++ and am writing a multi-threaded app whereby different writers will be pushing objects onto a stack and readers pulling them off the stack (or at least pushing th

6条回答
  •  逝去的感伤
    2021-01-30 19:21

    AFAIK, no built in support in C++. You will have to synchronize the stack operations using a simple synchronization tool. CriticalSection would do if threads belong to same proceass otherwise go for Mutex.

提交回复
热议问题