由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - C++11 native thread问题
相关主题
pthread and C++scala/spark现在情况怎样?
C++多线程的选择学习multi threading, 有什么好书?
Linux thread和NPTL thread什么关系? (转载)请教一个linux下的POSIX timer的问题。
多线程的程序设计有什么好书推荐? (转载)请问这些问题应该在那种书上找到答案?
btw, MS C++ 是ECMA-372标准java比js难多了
一个C#使用C++.NET类库的问题请推荐几本Multi-threading的编程书籍
VC++线程问题容器里边放指针怎么办?
access function static variable顺便问问Node的几个问题
相关话题的讨论汇总
话题: thread话题: c++话题: future话题: native话题: complete
进入Programming版参与讨论
1 (共1页)
EM
发帖数: 715
1
怎么知道一个thread已经complete了?
thread.joinable(), future<>.valid, future<>.wait_for(), future<>.wait_util()
好像都不行嘛
请C++大侠们指教
t****t
发帖数: 6806
2
i don't think you can check whether a thread is completed. So you have to do
it yourself: set a shared flag at the end of thread.

()

【在 EM 的大作中提到】
: 怎么知道一个thread已经complete了?
: thread.joinable(), future<>.valid, future<>.wait_for(), future<>.wait_util()
: 好像都不行嘛
: 请C++大侠们指教

EM
发帖数: 715
3
就是很好奇为什么native language的future template class不保留is_ready(),
anthony williams的justthread里面的future就有这个函数,难道没有通过?

do

【在 t****t 的大作中提到】
: i don't think you can check whether a thread is completed. So you have to do
: it yourself: set a shared flag at the end of thread.
:
: ()

t****t
发帖数: 6806
4
POSIX thread can not check whether a thread is completed.

【在 EM 的大作中提到】
: 就是很好奇为什么native language的future template class不保留is_ready(),
: anthony williams的justthread里面的future就有这个函数,难道没有通过?
:
: do

EM
发帖数: 715
5
native thread阿,不是pthread...

【在 t****t 的大作中提到】
: POSIX thread can not check whether a thread is completed.
r*********r
发帖数: 3195
6
c++ 有什么native threads?
libstdc++ 多半是用 pthread 写的。
h**********c
发帖数: 4120
7
A thread is complete, you will know it.
But there is no reliable way, as far as I know, to check a thread is
complete.
Let's say a process, you must set the read or write lock for the process
table,you read a state, when you release the lock, another state.
t****t
发帖数: 6806
8
问题是, C++不可能管你的native thread. 能写进C++标准的一定是大家都有的.

【在 EM 的大作中提到】
: native thread阿,不是pthread...
t****t
发帖数: 6806
9
应该是什么平台就有什么实现吧. STL里都是wrapper而已.

【在 r*********r 的大作中提到】
: c++ 有什么native threads?
: libstdc++ 多半是用 pthread 写的。

c*******y
发帖数: 1630
10
thread::timed_join(0) but possible race condition.
It will return false if the thread is still running.

()

【在 EM 的大作中提到】
: 怎么知道一个thread已经complete了?
: thread.joinable(), future<>.valid, future<>.wait_for(), future<>.wait_util()
: 好像都不行嘛
: 请C++大侠们指教

1 (共1页)
进入Programming版参与讨论
相关主题
顺便问问Node的几个问题btw, MS C++ 是ECMA-372标准
还有多少码工用windows machine的?一个C#使用C++.NET类库的问题
大家看过来Re: C++ Guys!!!!VC++线程问题
一个奇怪的library linking问题(c++, boost.python, shared li (转载)access function static variable
pthread and C++scala/spark现在情况怎样?
C++多线程的选择学习multi threading, 有什么好书?
Linux thread和NPTL thread什么关系? (转载)请教一个linux下的POSIX timer的问题。
多线程的程序设计有什么好书推荐? (转载)请问这些问题应该在那种书上找到答案?
相关话题的讨论汇总
话题: thread话题: c++话题: future话题: native话题: complete