pthreads
Pthread Mutex locking
I have a basic question on mutext handling. I have a file which appears at 2 other threads(out of 3). I need to mutually exclude access to it by a thread. So I do the following in a function called fr[详细]
2023-03-20 02:42 分类:问答What happens when pthreads wait in mutex_lock/cond_wait?
I have a program that should get the maximum out of my cpu. It is multithreaded via pthreads that do their job well apart from the fact that t开发者_运维知识库hey \"only\" get my cores to about 60% l[详细]
2023-03-20 01:23 分类:问答Segmentation fault for pthreads in a recursive call
Given the code below, I get a segmentation fault if I run it with n>16. I think it has something to do with the stack, but I can\'t figure it out. Could anyone give me a hand? The code is not mine,[详细]
2023-03-19 19:26 分类:问答Thread execution issue
I\'m approaching C programming with threads and I can\'t get this program to work properly. Basically there\'s a vector with k elements, n threads and each thread has to calculate the max on its k/n e[详细]
2023-03-19 16:56 分类:问答How to make the program work this way?
So i have a program that does these calculations with numbers. The program is threaded, and the number of threads are specified from the user.[详细]
2023-03-19 11:18 分类:问答Limiting number of concurrent theads execution in pthreads
I\'m very new to pthread world. I need to process a file with list of commands, let say the file looks like this-[详细]
2023-03-19 06:51 分类:问答Scheduling huge number of threads so only 4 are executed in parallel
As already stated in the title I have a large number of threads (probably much higher than 100) that are rather saving a program state than running. I want only few of them (enough to use all physical[详细]
2023-03-19 05:09 分类:问答Weird thread execution order?
I wrote a small program to see the amount of overhead there is to create a thread. Here is the program (I wrote it quickly so it isn\'t the best):[详细]
2023-03-19 04:39 分类:问答how the child POSIX thread is canceled
// threadA.c int main() { int res; pthread_t a_thread; void *thread_result; res = pthread_create(&a_thread, NULL, thread_function, NULL);[详细]
2023-03-19 00:31 分类:问答When is pthread_spin_lock the right thing to use (over e.g. a pthread mutex)?
Given that pthread_spin_lo开发者_运维知识库ck is available, when would I use it, and when should one not use them ?[详细]
2023-03-18 22:37 分类:问答
加载中,请稍侯......