openmutex()与createmutex()的差别------清华大学操作系统作业(读者写者问题中)

wangjf2003 2003-10-23 04:28:02
我在主线程中createmutex(NULL,false,“mutex”)之后,在子线程中用waitforsingle()等待出现问题。
但是我在wait之前openmutex后却没有问题。请教诸位openmutex到底有何用途???我读了msdn的帮助和例子以及侯捷的win32 multithread都没有详细讲。有机会谈谈大家在工程实践的用法。
...全文
738 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
vcforever 2003-10-27
  • 打赏
  • 举报
回复
详情请看http://expert.csdn.net/Expert/topic/2393/2393688.xml?temp=.0794794
这篇文档是讨论关于重复创建Mutex的问题,里面关于核心对象Mutex的很多方面,包括楼主的
CreateMutex()和OpenMutex()的差别的问题都做了讨论,非常精彩!
black_fox 2003-10-25
  • 打赏
  • 举报
回复
The OpenMutex function enables multiple processes to open handles of the same mutex object. The function succeeds only if some process has already created the mutex by using the CreateMutex function. The calling process can use the returned handle in any function that requires a handle to a mutex object, such as the wait functions, subject to the limitations of the access specified in the dwDesiredAccess parameter.

huanyun 2003-10-24
  • 打赏
  • 举报
回复
互斥对象
panzhaoping 2003-10-24
  • 打赏
  • 举报
回复
你没看过windows核心编程巴,那里讲的很清楚的,
createmutex是创建一个呼哧对象。

15,472

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 进程/线程/DLL
社区管理员
  • 进程/线程/DLL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧