Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 6 years ago. Improve this question I’m having an odd issue where my C++ multithreaded program doesn’t run to
Tag: pthreads
PHP pthreads failing when run from cron
Ok, so lets start slow… I have a pthreads script running and working for me, tested and working 100% of the time when I run it manually from the command line via ssh. The script is as follows with the main thread process code adjusted to simulate random process’ run time. So while the above script will run via a
How to forking process in a way such that reaping the child isn’t neccessary
I seem to have a vague memory that some facility in Linux exists that allows one to fork() a process in such a way that the child is automatically reaped by the system without a zombie being created. What is this mechanism? Or is my memory just wrong? Answer The portable way to do this is to double-fork:
Socket Server Memory usage goes up, becomes unresponsive
I have the following socket server code for Linux using Pthreads. If I start stress testing this with: The memory increases to about 270MB then the server becomes unresponsive: On ARMv7 architecture this takes a shorter time. If I stop the requests with the for loop, the memory does not get freed up, meaning that this server would sooner or
Segmentation fault (exit code 139) when using pthread_join
I’m doing some first steps with threads on Linux systems, and i have this error which occures on the base of a program that gets some n argument and creates n number of threads. Here is the important part of the code: The function the threads should run: Important part of code in the main function Notice the last for
pthread not waiting for mutex lock threadFinished
Hi below is my coding snippet When statement1 & statement2 are commented I am expecting child thread to change my testrunning variable first before main thread but it is working properly only when statement1 and statement2 are uncommented. My question is why in child thread mutex lock is not locking my testrunning variable . it is allowing main thread to
Difference in behaviour between code executed by a pthread and the main thread in x64-assembly
When writing some x64 assembly, I stumbled upon something weird. A function call works fine when executed on a main thread, but causes a segmentation fault when executed as a pthread. At first I thought I was invalidating the stack, as it only segfaults on the second call, but this does not match with the fact that it works properly
fwrite fopen blocking threads
I have a multithreaded linux app written in c running on a i.mx6 arm. I have a 25lc256 spi eeprom mapped to the file system. Writes are relatively slow at the driver level, not much can be done there. The problem is that file functions are blocking other threads for too long. usleep additions don’t seem to help, it appears
Linux scheduling. (pthreads)
I’m trying to play around with threads and so far, with the code below, I’m doing fine. I want also want to print the current index of the executing thread but I’ve encountered some problems. I’m trying to print the current executing thread along with “Hello world!”. But, the output is this… So far, I’ve already tried issuing What can
Get/Set the pthread scheduling policy in Linux
The code below is a sample provided by the book in my Operating Systems course. When compiling it I get the error shown below it. I compiled it using this command… However, I get this error. I tried adding -pthread: but the error remains. Thanks for your help! Answer You have the correct compiling command: but you need to put: