avatar
Help needed, about pthread...# Unix - 噫吁兮,危乎高哉
O*d
1
Can anyone help me with it?
In my main thread I am creating multiple threads to support multiple clients,
but only the first child-thread created by the main thread runs, all the
other following threads just don't run at all, anyone knows why?
thank you :(
btw, i am working on a multi-client game server, faint
avatar
m*m
2

How do you tell if they are not running?

【在 O*****d 的大作中提到】
: Can anyone help me with it?
: In my main thread I am creating multiple threads to support multiple clients,
: but only the first child-thread created by the main thread runs, all the
: other following threads just don't run at all, anyone knows why?
: thank you :(
: btw, i am working on a multi-client game server, faint

avatar
f*e
3

I guess the reason is in some Unix platform thread is not
using round-robin scheduling policy by default, and your
first thread never block to give other thread a chance to
run. Try to set scheduling policy as round-robin if it's
not. Good luck!

【在 O*****d 的大作中提到】
: Can anyone help me with it?
: In my main thread I am creating multiple threads to support multiple clients,
: but only the first child-thread created by the main thread runs, all the
: other following threads just don't run at all, anyone knows why?
: thank you :(
: btw, i am working on a multi-client game server, faint

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。