腾讯云
开发者社区
文档
建议反馈
控制台
登录/注册
首页
学习
活动
专区
工具
TVP
最新优惠活动
文章/答案/技术大牛
搜索
搜索
关闭
发布
精选内容/技术社群/优惠产品,
尽在小程序
立即前往
文章
问答
(9999+)
视频
沙龙
1
回答
有可能获得GMutex锁的线程所有者吗?
、
、
、
、
我注意到有可能获得the thread holding the
mutex
lock on a
ptread
。 GMutex也是如此吗?我在文档中没有找到任何参考资料。
浏览 22
提问于2020-11-11
得票数 0
1
回答
pthread_
mutex
_lock和EAGAIN
、
、
、
、
<stdio.h>#include <math.h>#include <unistd.h> } pthread_
t
t
1;#in
浏览 3
提问于2018-01-04
得票数 1
回答已采纳
1
回答
使用信号量的消费者和生产者
、
、
我有以下内容int isEmpty[SLOTCOUNT]; FILE *myOutFile; //Create the basics of threads and intilize the sem sem_init(&buf_
浏览 2
提问于2013-03-29
得票数 2
回答已采纳
2
回答
在pthread中计算pi
、
、
<time.h> pthread_
mutex
_
t
mutex
1 = PTHREAD_
MUTEX
_INITIALIZER; //creates a
mutex
variabledouble sumvalue=0,sum=0; main()
浏览 0
提问于2013-02-04
得票数 0
2
回答
使用p线程编译/链接错误
、
、
、
错误:为了便于编译,我使用了make文件,但在命令行中,我无法让它工作int ret =
ptread
_create(&threads[0], NULL, threadOne(), NULL);sortieren.o: In function `main': sortieren.c:(.te
浏览 1
提问于2011-06-13
得票数 4
回答已采纳
1
回答
Boost::
mutex
性能与pthread_
mutex
_
t
、
、
我之前用的是pthread_
mutex
_
t
的。代码有时会卡住。我有几行代码分散在我包装的函数中…… //critical code involving reading/writingwrapped around a
mutex
//Line 2 pthread_
mutex
_unlock(&map_
mutex</
浏览 1
提问于2012-08-21
得票数 3
回答已采纳
2
回答
有条件的睡眠?
、
、
、
它应该这样工作:{
ptread
_
t
t
; while{ switch(msg) //sleep_pthread(
t
); case 2:
浏览 3
提问于2015-09-24
得票数 0
1
回答
std中崩溃::map clear() -多线程
、
、
、
、
在多线程应用程序中,我面临着一个奇怪的崩溃: (void)lock(map_
mutex
); (void)unlock(map_
mutex
); (void)lock(map_
mutex
);>, std::allocator<std::pair<int const, std::string> &
浏览 1
提问于2015-08-03
得票数 2
回答已采纳
1
回答
多线程互斥段故障
、
、
、
、
t
1,
t
2,
t
3; pthread_
mutex
_init(&
mutex
, NULL); pthread_create(&
t
2, NULL, &increment, &<em
浏览 3
提问于2014-11-06
得票数 1
回答已采纳
2
回答
使用pthread创建线程安全队列是正确的方式吗?
、
、
template<class
T
>private: pthread_
mutex
_
t
_
mutex
;(&_condition);void SafeQueue<
T
>::push(const
T
&x){ pthread_
mutex</em
浏览 45
提问于2021-06-14
得票数 0
3
回答
如何使用malloc为非指针对象分配空间?
、
、
我是个C新手,一直致力于获取指针之类的东西。我正在学校做一个练习,在这个练习中,我们应该分配我们所有需要的内存,包括互斥。据我所知,malloc总是返回指向某个内存的指针(除非失败)。如果是这样的话,你将如何malloc像互斥锁这样的东西,这基本上不是一个指针?最后,我不希望任何人担心“给我答案”,因为这不是分配给我的问题;相反,这是我们应该执行的内存监视的必要条件;我只是不确定正确的语法应该是什么。
浏览 2
提问于2013-04-08
得票数 2
1
回答
线程同步
、
我有一个有两个线程的进程,它是这样工作的while( true ){ Notify/wakeup Thread2 after time'
t
' ....Thread2 wait for a signal from Thread1 do some stuff
浏览 2
提问于2012-03-02
得票数 0
1
回答
作用域互斥锁的自定义RAII C++实现
、
、
、
、
我不能使用boost或最新的std::线程库。方法是创建作用域互斥的自定义实现。有可用的实现吗?我不想重新发明轮子。
浏览 0
提问于2011-11-02
得票数 13
回答已采纳
1
回答
Mono Embed:用于同步托管和本机互斥锁
、
、
、
如下所示:native_lock_
mutex
(&db_
mutex
);native_unlock_
mutex
(&db_
mutex
);managed_lock_
mutex
(db_
mutex
);managed_unlock_
mutex
(db_
mutex
);
浏览 1
提问于2012-11-01
得票数 2
回答已采纳
2
回答
是否有必要在main的末尾解锁互斥体?
、
#include <pthread.h>pthread_
mutex
_
t
activeMutex;{" << myId << endl; pthr
浏览 15
提问于2016-09-21
得票数 1
回答已采纳
1
回答
为什么线程教程中的MSDN示例崩溃?
、
、
、
、
Mutex
Sample"); { Thread.Sleep(2000);
浏览 0
提问于2009-08-02
得票数 5
回答已采纳
1
回答
销毁性病:互斥对pthread_
mutex
_
t
、
、
在CPP中,std::
mutex
和pthread_
mutex
_
t
有什么区别?动态分配每个互斥类型的正确方法如下::
mutex
*
mutex
2 =新std::
mutex
();
浏览 11
提问于2022-04-20
得票数 0
1
回答
在结构中使用pthread条件变量数组
、
<pthread.h>#include <unistd.h> //pthread_
mutex
_
t
*
mutex
= (pthread_
mutex
_
t
*)malloc(sizeof(pthread_
mutex
_
t
)); //pthread_cond_
t</em
浏览 21
提问于2018-12-14
得票数 1
回答已采纳
1
回答
错误检查互斥锁与递归互斥锁
、
、
、
、
我想知道我是否可以用一个PTHREAD_
MUTEX
_ERRORCHECK互斥锁自己创建一个递归互斥锁类型,结果是: pthread_
mutex
_
t
mutex
;(pthread_recursivemutex_
t
*
mutex
) int ret;} void pthread_recurs
浏览 7
提问于2014-04-13
得票数 1
1
回答
cygwin pthread_
mutex
_timedlock代理
、
、
、
不幸的是,cygwin、GCC、4.5.3 pthread库实现不支持POSIX标准函数 if(valid) if(timeout == TimeDuration<>::Zero) if(p
浏览 1
提问于2012-06-26
得票数 4
回答已采纳
点击加载更多
扫码
添加站长 进交流群
领取专属
10元无门槛券
手把手带您无忧上云
相关
资讯
Linux系统编程 互斥量mutex
使用互斥锁(Mutex)管理共享资源
文盘Rust -- Mutex解决并发写文件乱序问题
图解Go里面的互斥锁mutex了解编程语言核心实现源码
Linux系统编程 条件变量
热门
标签
更多标签
云服务器
ICP备案
云直播
对象存储
腾讯会议
活动推荐
运营活动
广告
关闭
领券