由买买提看人间百态

topics

全部话题 - 话题: pthreads
首页 上页 1 2 3 4 5 6 7 8 下页 末页 (共8页)
E*****7
发帖数: 128
1
Is there anyone here who have experience with using Cilk++ under Visual
Studio IDE to develop Multithreading /Parallelism applications? Is this a
good tool for developing such applications?
I got most updated news: now there are only Linux version of Cilk++ available. The Cilk++ for Windows will come out very soon.
What are other software / tools available to us or those you use? Thanks.
除了Linux / Unix下的Pthread, 大家还用别的什么平台 / 库做Multighreading?
h***i
发帖数: 1970
2
来自主题: Programming版 - Pthread support on Windows XP
就是这么简单。
E*****7
发帖数: 128
3
来自主题: Programming版 - Pthread support on Windows XP
So I have to link these DLLs and include head files for my every project?
Does anybody know if this works from within a project in Visual Studio 2005
/2008? Thanks.
k***r
发帖数: 4260
4
来自主题: Programming版 - DJGPP下怎样用pthread.h?
djgpp哪里好呀。可以考虑mingw/msys或者cygwin,如果想要
类似于unix的环境的话
F******8
发帖数: 51
5
来自主题: Programming版 - DJGPP下怎样用pthread.h?
谢谢!下载了。安装后试试。
F******8
发帖数: 51
6
来自主题: Programming版 - DJGPP下怎样用pthread.h?
谢谢。我也试试。
j**7
发帖数: 771
7
来自主题: Programming版 - 请教一个c语言实现多线程的问题
求教一个用C语言实现对多线程的运行结果等待,windows和visualstudio2005环境下(
非Linux pthread,尽量不使用winAPI)。具体如下,使用了_beginthread开始了若干
个线程,但想在主线程中等待这些线程运行结束一遍进行后续操作。不知道是否有单一
函数或简洁操作能够实现。望各位不吝赐教啊~
p***o
发帖数: 1252
8
来自主题: Programming版 - 请教一个c语言实现多线程的问题
找个写好的wrapper用估计没这些头疼的问题,比如boost thread和pthreads-win32。
移植起来也容易得多。
t****t
发帖数: 6806
9
来自主题: Programming版 - c++问题
on the contrary, pthread use mutex for critical section.
p***o
发帖数: 1252
10
来自主题: Programming版 - c++问题
pthread has a spinlock. Probably you can use that to construct
something similar to critical section in Win32.
X****r
发帖数: 3557
11
来自主题: Programming版 - waiting for N condition variables in linux
pthread系列的wait/signal本身不传递数据,所以你反正也要用共享的变量,
加一个谁signal的变量不就行了。
g****y
发帖数: 436
12
来自主题: Programming版 - help on pthreads.....
gdb output:
Program received signal SIGSEGV, Segmentation fault.
pthread_join (threadid=0, thread_return=0x7fffffffe040) at pthread_join.c:46
46 pthread_join.c: No such file or directory.
in pthread_join.c
(gdb) bt
#0 pthread_join (threadid=0, thread_return=0x7fffffffe040)
at pthread_join.c:46
#1 0x0000000000410fab in joinThread (th=0) at threading.h:18
#2 0x0000000000413270 in ranger (argc=32767, argv=0x7ffff584b910)
at ranger.c:432
#3 0x000000000040a9e7 in main (argc=12, arg
k*****2
发帖数: 252
13
来自主题: Programming版 - help on pthreads.....
please paste all your code if possible...
j******n
发帖数: 271
14
来自主题: Programming版 - help on pthreads.....
check the return code.
g****y
发帖数: 436
15
来自主题: Programming版 - help on pthreads.....
THanks! Did you mean the return code of pthread_join?
t****t
发帖数: 6806
16
did you mean -pthread? that is the same as /MT for VC. only links with diffe
rent library and defines some macro.
and I repeat! this is not a bug!!!
d****f
发帖数: 313
17
工作中牵涉到一个稍微复杂一点的线程同步问题,问题描述如下:
有两个thread:t1和t2
1、t1做N个时间步,t2做一个时间步(都是差分时间步),换句话说每个t2和N个t1同步
2、同步时,t1和t2要交换一下数据,t1先传1个链表tL1给t2,t2用这个tL1算两个链表
值(DataProcess),tL2a,tL2b,一个要回传给t1(tL2a,之后t1的N步都要用到这个tL2a
),另一个tL2b是t2下一步自己计算要用到的,这个过程是串行(原来并行的强制串行
).
3、交换完数据,t1和t2各自完成自己时间步计算,这个过程中t1做一个积分(N步),
t2解一个方程,无论哪个先完成,都需要等到双方都完成了,才能开始下一轮的计算(
也就是回到2),这个过程是并行的.
我贴了一个简单的框架,只是保证t1做一步,t2做一步,因为刚开始接触并行内容,所
以请各位大牛指点一下,这个每轮先串行后并行的过程如何实现,比如是不是需要两个
mutex,两个condition variable,等等,希望我已经描述清楚了, 谢谢!
//------------------------------
c*******9
发帖数: 6411
X****r
发帖数: 3557
k*******d
发帖数: 1340
20
来自主题: Programming版 - 求建议:C++的TCP/IP编程库
我。。不会用XML啊
我还是希望能够像是socket的wrapper那样的,也就是function都能基本和原来socket
里面的function对应上的
就像如果不想用pthread可以用boost::thread一样,可惜boost没有network
programming。。。
t****t
发帖数: 6806
21
来自主题: Programming版 - double-checked locking
well this depends on call_once implementation. i heard on pthread it does
use double checked locking, but sometimes it's broken.
g*********s
发帖数: 1782
22
【 以下文字转载自 JobHunting 讨论区 】
发信人: gandjmitbbs (Nothing), 信区: JobHunting
标 题: 多线程的程序设计有什么好书推荐?
发信站: BBS 未名空间站 (Sat Jan 15 12:11:19 2011, 美东)
C++ and pthread.
主要想找些题目练手。
c***k
发帖数: 1589
23
这个推荐不靠谱吧……
这本圣经除了讲了几节POSIX的pthread API和mutex,几乎没有介绍多线程的思想啊
b*******s
发帖数: 5216
24
#include "pthread.h"
gcc -lpthread
X****r
发帖数: 3557
25
I don't see how pthread relates to sockets.
X****r
发帖数: 3557
26
I don't see how pthread relates to sockets.
g*********s
发帖数: 1782
27
来自主题: Programming版 - question about the read/write locker
can any da niu share ideas of implementing class semaphore and class
rwlock using pthread mutex only?
g*********s
发帖数: 1782
28
来自主题: Programming版 - question about the read/write locker
i want to learn how to implement it.
somehow my pthread only has header and lib files. where can i find its
source code?
p***o
发帖数: 1252
g*********s
发帖数: 1782
30
来自主题: Programming版 - how to statically initialze a mutex in class?
the following code gives me warnings. what does it mean and does it matter?
inclass_mutex.cpp: In constructor ‘X::X(unsigned int)’:
inclass_mutex.cpp:8: warning: extended initializer lists only available with
-std=c++0x or -std=gnu++0x
inclass_mutex.cpp:8: warning: extended initializer lists only available with
-std=c++0x or -std=gnu++0x
#include
class X {
public:
X(unsigned int in_sz = 0): sz (in_sz)
{
buffer = new int[sz];
lock = PTHREAD_MUTEX_INITIALIZER;
... 阅读全帖
r****t
发帖数: 10904
31
来自主题: Programming版 - how many ways in C++ to release a mutex?
is this new thread support library supposed to be cross-platform?
和 boost::thread and pthread 这些是啥关系?
如果要入门的话看点啥好,
还是只有读 http://www.stdthread.co.uk
d**d
发帖数: 389
32
来自主题: Programming版 - 请教一个linux下的POSIX timer的问题。
我用linux下面的POSIX timer, timer_create(),timer_settime(),
为什么在调用了timer_settime()以后,立马就有一个time-out callback? 然后再每过
5秒后有一个time out?
难道不是我调用timer_settime()以后,timer开始计时, 等到5秒以后再出现第一
time out callback 吗?
非常感谢!
代码如下:
#include
#include
#include
#include
#include
void
handle (sigval_t v)
{
time_t t;
char p[32];
time (&t);
strftime(p,sizeof(p),"%T ",localtime(&t));
printf("%s thread 0x%x,val=%d,signal captured.... 阅读全帖
g*******e
发帖数: 3013
33
有本pthread的书。
p*a
发帖数: 592
34
来自主题: Programming版 - multithread: how to lock a thread
什么平台?问都死用event,mutex。有你可死好久不用生疏了,可能是critical section或者conditional
variable,放狗查pthread
t****t
发帖数: 6806
35
来自主题: Programming版 - C++多线程的选择
i assume you are talking about unix -- in that case, c++0x is usually
another wrapper of pthread. in fact, STL in c++0x is (more or less) a port
of boost.

stl
d**t
发帖数: 183
36
My guess is that Boost.Thread is faster. It has been added to the new C++
standard.
l******9
发帖数: 579
37
Are there other reasons ? Just because it will be in new standard ?
Thanks
O*******d
发帖数: 20343
38
我个人比较喜欢OpenMP。 不需要加很多code,最简单的就只需要加一行, compiler就
可以自动把for loop平行。 线程的数目自动和你的CPU核的数目一致,每个核执行for
loop的不同index。 这些全都是自动的,不需要你操心。 你可以做data parallelism
和task parallelism.
m***x
发帖数: 492
39
Data parallel use openmp.
M**u
发帖数: 10158
40
来自主题: Programming版 - How to avoid deadlock ?
in pthread, there is error-check mutex
Default mutex is fast mutex, which cannot check

But
t****t
发帖数: 6806
41
来自主题: Programming版 - 请教pthread producer-consumer问题
你这个显然不对, producer可以一直跑不带停的.
t****t
发帖数: 6806
42
来自主题: Programming版 - 请教pthread producer-consumer问题
你什么系统, 不带semaphore的? 20年前的DOS吗?
M**********n
发帖数: 432
43
来自主题: Programming版 - 请教pthread producer-consumer问题
This is interesting.
My result is different but valid every time when I ran it. For thread
application, the results could be unpredictable. It looks like you producer
thread is blocked in the second loop waiting for the mutex while the
consumer continues acquiring mutex and print results.
A**u
发帖数: 2458
44
来自主题: Programming版 - 请教pthread producer-consumer问题
多谢大牛回复
我用的mac gcc
这么编译的 gcc main.cpp
A**u
发帖数: 2458
45
来自主题: Programming版 - 请教pthread producer-consumer问题
谢谢
问题找到了,是
sem_init()初始化不成功,
但为什么不成功呢

producer
A**u
发帖数: 2458
46
来自主题: Programming版 - 请教pthread producer-consumer问题
mac下没有lrt
我用rt代替,
还是一样, semaphore初始化出错
p***o
发帖数: 1252
M**********n
发帖数: 432
48
来自主题: Programming版 - 请教pthread producer-consumer问题
"我的系统上 errno 78 是
#define ENOSYS 78 /* Function not implemented */"
According to your own post, "Function not imoplemented" on your MAC OS.
A**u
发帖数: 2458
49
来自主题: Programming版 - 请教pthread producer-consumer问题
好吧。。。太谢谢你了。
A**u
发帖数: 2458
50
来自主题: Programming版 - 请教pthread producer-consumer问题
太好了。
首页 上页 1 2 3 4 5 6 7 8 下页 末页 (共8页)