DLL thread safety

前端 未结 3 860
南方客
南方客 2021-01-26 06:52

I am developing a DLL in MS VC express c++ that will be loaded in multiple client applications at the same time, the DLL has a shared memory space created using data_seg(\

3条回答
  •  星月不相逢
    2021-01-26 07:22

    Looks like you need a system-wide mutex that will protect your critical section of code (the code that mustn't run simultaneously). Making the function static has nothing to do with it, because it doesn't prevent different applications from running it at the same time.

提交回复
热议问题