开发者

Mutex on 1 byte shared resource

开发者 https://www.devze.com 2023-01-07 15:01 出处:网络
Is 开发者_开发问答Mutex required on 1 byte shared resource? If not then why not? Consider I am using normal desktop PC pentium IV , 32 bit. Will condition change if use core 2 duo?It depends what you

Is 开发者_开发问答Mutex required on 1 byte shared resource? If not then why not? Consider I am using normal desktop PC pentium IV , 32 bit. Will condition change if use core 2 duo?


It depends what you are going to do with it, but if you have multiple writers, implemented in C or C++, then yes you need a mutex - the size of the resource is not the issue.


CPU doesn't matter as the task scheduler is free to interrupt a thread at any time. Size doesn't matter. If it's shared then you need some method of locking.

0

精彩评论

暂无评论...
验证码 换一张
取 消