Questions tagged [pthreads]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
23 views

Why htop display threads with different PID [duplicate]

I'm using htop to look at one of my process. It display all the threads of my process. They all have a different PID, but when I display them from my process with the getpid function they are all in ...
0
votes
0answers
20 views

Linux pthread_cond_wait hangs in NASM

The following NASM code uses pthread_cond_wait to take 4 cores (numbered 0, 8, 16, 24) in core order, starting with core 0. After each core locks the mutex, it enters mutex_lock_loop where it tests ...
0
votes
1answer
22 views

Do all threads originating from the same process sleep on wait_event_interruptible()?

If I have 3 pthreads: A, B, C, all originating from the same process, running in user space and one thread, thread B does a blocking read from a kernel module and is put to sleep, will threads A and C ...
1
vote
0answers
34 views

Behavior of Linux kernel with respect to machine check exceptions (MCE) and threads

I was recently working with custom hardware that was not fully respecting the PCIe bus standards, and certain reads from the device would cause a bus fault and Linux machine check exception. When this ...
-1
votes
1answer
553 views

fatal error : linux/interrupt.h : no such file or directory

I am developing code for interrupt. When I am including #include <linux/interrupt.h>, I get fatal error : linux/interrupt.h no such file or directory Why am I getting this error and how can I ...
4
votes
2answers
246 views

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
96 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
192 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
1answer
64 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
126 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
538 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
84 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
3k 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 ...
6
votes
1answer
4k 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
34 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
622 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
969 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
353 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-...