Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [pthreads]

The tag has no usage guidance.

2
votes
1answer
38 views
+50

unable to create new native Thread or Resource temporarily unavailable after 10K threads

I'm trying to allocate more than 10K threads on both a Fedora 30 (12GB of RAM) and Ubuntu 16 Linux machines (16GB of RAM). I get these errors around 10k threads: Java: unable to create new native ...
0
votes
0answers
23 views

Can a signal in one thread, interrupt sleep period of another thread of the same process in linux

There are two threads (parent thread and child thread, both runs in their own infinite loop) in a process. The parent thread does only one work, i.e. to continuously (while(1)) check the system time ...
0
votes
1answer
28 views

How can I view threads for a running process that is creating threads?

I made a very small program that creates two threads: #include <pthread.h> #include <stdio.h> #include <unistd.h> void *start() { printf("Am a new thread!\n"); ...
1
vote
0answers
30 views

Can the overhead of rwlock is higher than the overhead of mutex? [closed]

I implemented a sorted linked list as two versions. First one is using single mutex for the entire list and the sencond one is single rwlock for the entire list. I run half of the operations as Member ...
1
vote
1answer
40 views

file lock existence check on remote host

I want to check the existence of file lock on a file in gluster file system. So that I can see from any host that whether file lock is held by any process (remote or local) on file in gluster file ...
1
vote
0answers
93 views

OpenBSD threads priorities

Can anybody explain how to work with thread priorities in OpenBSD? Information about this question in MAN pages is poor, it does not give clear understanding. In particular: sched_get_priority_min/...
0
votes
1answer
126 views

Is it recommended to use param.sched_priority in Linux FIFO during thread creation?

In my embedded device I absorb strange behaviour with the protocol we use, sometimes it takes a while to send the data via serial device using FIFO. My suspicion is Linux is not real-time OS and why ...
1
vote
0answers
73 views

Linux (kernel 3.x and 4.x) Pthread and general process scheduling algorithms

I was wondering if both scheduling (contention) scopes (SYSTEM and PROCESS) are used in the Linux kernel scheduling logic. POSIX supports PROCESS scope pthreads (MXN model) and SYSTEM scope pthreads (...
0
votes
1answer
2k views

Custom priority value: is a pthread high sched prio positive or negative?

I’m trying to reimplement in a backward-compatible way the RobotC API from C (although some details would better fit or would be easier with C++), and trying to reimplement their multithreading API in ...
5
votes
1answer
2k views

Get PID from TID

I run iotop to check on programs that are heavy disk users, in case I need to decrease their priority. Usually this is good enough, but iotop only shows thread ID (TID), and sometimes I want to know ...
0
votes
2answers
31 views

Thread Creation

Why do we use pthread_exit(NULL) method in main() method when creating threads? #include <stdio.h> #include <unistd.h> #include <pthread.h> void *message(void *arg){ char *...
1
vote
2answers
403 views

How to comprehend Cpus_allowed and thread id number?

Environment: OS --debian + python3. All the output info below ommit unimportant. Get my computer's cpu info with cat /proc/cpuinfo : cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu ...
4
votes
0answers
592 views

Portable way to get all thread ids running inside a process.

During the porting of an application form Linux to FreeBSD I came up with the following problem. I need to get all thread id of all threads running inside my application. In terms of PThreads, I need ...
1
vote
0answers
243 views

Suddenly I see a lot of involuntary context switches for multi threaded app

I have a multi-threaded app, with 4 worker threads that until recently performed very well on my 4-core CPU. The system is running Ubuntu 16.04.3 LTS. Today I updated my OS with sudo apt-get dist-...