Questions tagged [thread]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
-1
votes
0answers
20 views

Program closing thread when button pressed Raspberry Pi

I realize there are similar questions here and I have looked at them, I just can't apply the solutions to my own problem. I am writing an MP3 player for a Pi using visual studio (C#) on a PC, then ...
0
votes
1answer
84 views

Naming convention of worker threads

I started reading about worker threads. Old Legacy worker threads is replaced with worker pools. $ ps -ef | grep 'kworker' root 6 2 0 04:41 ? 00:00:00 [kworker/0:0H-kb] root ...
0
votes
1answer
116 views

What data structure is the stack using in Linux?

I have looked in several places such as here but none explain in detail the structs used for implementing the stack itself (the place where "tasks" (processes/threads) store their nested call ...
-3
votes
1answer
70 views

Reasons that may cause a running process to voluntarily or involuntarily give-up the CPU?

What are the reasons that may cause a running process to voluntarily or involuntarily give-up the CPU? As only one process can be running in the CPU/Core at any one time.
1
vote
2answers
215 views

What types of threads does Java/JVM use from Linux OS's perspective?

A developer friend of mine recently asked the question: On a Linux system when a Java application runs which has threads, how do these threads appear to the underlying Linux OS? So what are Java ...
1
vote
1answer
15 views

How do I display the thread / child process count of a process in top?

I know there is a one-line-per-thread view (-H), but the particular threads are not grouped by master process. In fact, I would be completely satisfied with the sole thread count per process (= how ...
1
vote
0answers
26 views

Read per thread network statistics from C/C++

I have a Linux process with let's say 10 threads. Some of them make network traffic. From another thread or it can be even within another process I need to find out which threads have network activity....
0
votes
1answer
34 views

Why does gunicorn w/ workers as a daemon kill MySQL?

So, I've recently deployed my first Flask app with gunicorn. During deployment, I encountered the most peculiar issue. I had created a systemd unit file (the following is the working, functional ...
1
vote
0answers
26 views

Deterministic thread cancelation

Is there a way to deterministicly cancel threads (Light-weight process) in linux. Let say I want to cancel a thread because it is possible in an infinite loop or my scheduler requires it. How would ...
0
votes
1answer
201 views

Information on values in /proc/pid/task/tid/sched

can someone help me out with the meanings of the following terms in the output of /proc/pid/task/tid/sched? avg_per_cpu se.avg.util.sum se.avg.load.sum ravg.demand Do any of these values point to ...
0
votes
0answers
334 views

Get thread id by thread name

When I type ps -A -T I can see all threads, and threads name. Is there any way how to get thread id by thread name? When I want to get process name by process name I can use echo $(pidof XXX) , with ...
1
vote
0answers
13 views

How to find the number of threads in a OpenVZ containers

A am running a Spark application, it is possible to specify some parameters like the number of threads. My question : how I can find the number of threads in my container OpenVZ. Some details : $...
0
votes
0answers
127 views

Can two threads in the same process belong to different namespaces?

The task_struct structure has an entry nsproxy which points to namespaces associated with the task_struct. My understanding is that task_struct can be used to represent both process and threads in ...
0
votes
1answer
627 views

How can I list information about a thread/LWP by `ps`?

How can I list information about a thread/LWP by ps? Why can't I do that simply by: $ ps 10173 PID TTY STAT TIME COMMAND $ ps -L 10173 PID LWP TTY STAT TIME COMMAND The best I ...
2
votes
1answer
70 views

Look up a string in a log to set an alert and generate thread dumps

I need to write a script to create and alert and get thread dumps if a string (Related string is found) in a log file - /tmp/area.log. I am able to do this in 2 separate scripts so far but would like ...
0
votes
0answers
322 views

How to stop/kill thread in process

I see all of threads according process with ps -T Is there any way to kill/ stop specific thread(not all the process) by thread id/thread name? I prefer with shell script but if it impassable so in ...
1
vote
0answers
365 views

How to set the SCHED_RR time slice or time quantum per process / thread?

The time slice (also called time quantum) for threads with SCHED_RR policy can, according to the sched_rr_get_interval man page be obtained using int sched_rr_get_interval(pid_t pid, struct timespec *...
1
vote
0answers
94 views

Is it possible to create a thread without sharing memory space?

The http://www.man7.org/linux/man-pages/man2/clone.2.html write Since Linux 2.5.35, flags must also include CLONE_SIGHAND if CLONE_THREAD is specified (and note that, since Linux 2.6.0-test6, ...
1
vote
1answer
74 views

Distribution of threads among CPUs?

lscpu gives: Thread(s) per core: 2 Core(s) per socket: 32 When running an intensive 32-threads process, why does htop show almost 100% CPU activity on #1-32, but very little activity on #33-64? ...
4
votes
1answer
130 views

Is there a file that associates a thread to its network namespace?

/proc/[pid]/ns/net contains a link to the inode representing the network namespace of the process with PID [pid]. Is there something similar for threads? My use case is a multi-threaded application, ...
0
votes
1answer
306 views

SLES 11 SP4 'Resource temporarily unavailable' after upgrade from SP3

After upgrade from SLES 11 sp3 to sp4 I've met the problem while creating threads. Message I got was 'Resource temporarily unavailable'. Is it possible that upgrade changed limits somehow or maybe ...
1
vote
2answers
793 views

Are tgid and pid ever different for a process or lightweight process?

tgid and pid are the same concept for any process or for any lightweight process. In /proc/${pid}/status, tgid and pid are distinct fields. Are tgid and pid ever different for a process or ...
2
votes
2answers
878 views

Does Linux not distinguish between processes and threads?

As far as I know in Linux kernel, the structure task_struct represents threads i.e. light weight processes, but not processes. processes are not represented by any structure, but by groups of ...
2
votes
1answer
574 views

Are tid and tgid always the same as pid in the output of ps?

In manpage of ps tid TID the unique number representing a dispatchable entity (alias lwp, spid). This value may also appear as: a ...
0
votes
2answers
863 views

thread dump of Java using Kill -3

I used to take thread dumps using: kill -3 `pidof java` This will create thread dumps in catalina.out ; how to get those output to a file rather than in catalina.out. Usually kill command won't ...
0
votes
1answer
60 views

Does software threads include user threads?

From this answer - software threads vs hardware threads, software threads are threads managed by OS. But I also learn another term called user threads, which are threads that's not kernel threads, i.e....
1
vote
0answers
124 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/...
12
votes
1answer
5k views

What are the relations between processes, kernel threads, lightweight processes and user threads in Unix? [closed]

Unix Internal by Vahalia have figures showing the relations between processes, kernel threads, lightweight processes, and user threads. This book gives most attention to SVR4.2, and it also explores ...
1
vote
1answer
508 views

Is a light weight process attached to a kernel thread in Linux?

Based on my understanding from Understanding the Linux Kernel, is it correct that: kernel threads and light weight processes in Linux kernel are both represented by task_struct structure in C. ...
0
votes
1answer
92 views

Error message “jrcmd: not found” when I execute a script

I am getting the error below when I execute a script: Ksh: line 1: jrcmd: not found When I execute the same command in weblogic server, I get the output, but executing the same command inside a ...
2
votes
1answer
95 views

Run process as if on a single-core machine to find a bug

I have a bug in my Linux app that is reproducable only on single-core CPUs. To debug it, I want to start the process from the command line so that it is limited to 1 CPU even on my multi-processor ...
0
votes
1answer
318 views

What is contention? [closed]

I have been asked to measure the contention of locks a write process is causing. I was looking at the data of the lockstat for that write process. My questions are below: Is contention related to ...
0
votes
3answers
915 views

How does the kernel knows which “threads”/processes are associated with a process? [duplicate]

As I have read, a "thread" in Linux is just a process. Say that a process created two "threads", now when the process is terminated, the two "threads"/processes that are associated with the process ...
0
votes
1answer
343 views

What does “asynchronous” mean in these cases?

I have asked what "asynchronous" means a while ago for interrupts. Now I have the same question but for running shell commands and for cancelling threads. From Bash manual If a command is ...
22
votes
3answers
5k views

How does Linux tell threads apart from child processes?

Linux doesn't actually distinguish between processes and threads, and implements both as a data structure task_struct. So what does Linux provide to some programs for them to tell threads of a ...
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
1answer
62 views

Count the number of processes during compiling code

We are using ant as build system that calls different other tools (Java tools, Python scripts, Perl scripts, LaTeX and so on). Now I would like to know how many processes have been created during the ...
0
votes
1answer
123 views

Differences between threading and processes? [closed]

In an operating systems course (the operating System on which the course is covered is Linux) that I am participating in, we are told that: Processes have priority values which determine what process ...
2
votes
0answers
341 views

How to make strace keep following children after the death of the father/mother:))?

I use this command to trace all the things that are done or started from a shell. sudo strace -e trace=memory -o outm -ff -p <the pid of the terminal instance I want to trace> -f But the ...
13
votes
2answers
8k views

How to kill an individual thread under a process in linux?

These are the individual threads of Packet Receiver process. Is there any way to kill any individual thread? Does Linux provide any specific command which can kill or send stop signal to any ...
2
votes
0answers
98 views

determining number of free threads

Suppose that on a computer capable of processing n simultaneous threads, one wishes to launch n-m single-thread jobs where m is the number of threads currently in use. How is m defined and by what ...
1
vote
1answer
1k views

Could someone explain the sleep/wake dynamics in Linux?

I am studying the locking mechanisms in an OS and came across these POSIX functions: pthread_cond_wait(pthread_cond_t *c, pthread_mutex_t *m); pthread_cond_signal(pthread_cond_t *c); I fully ...
2
votes
3answers
3k views

How can I get information about threads of process?

Hi I wanted to get information about threads of process, so used /proc/stat command in terminal. But get "permission denied" error. How can I resolve this issue?
0
votes
0answers
245 views

Mapping Kernel-level Threads, User-level Threads to Process/Threads

I know this question has been brought up many times, however I can't find anywhere a definitive answer, so here it goes again: Is it true that Kernel Level Thread has it's own unique PID, while the ...
67
votes
7answers
22k views

Are threads implemented as processes on Linux?

I'm going through this book, Advanced Linux Programming by Mark Mitchell, Jeffrey Oldham, and Alex Samuel. It's from 2001, so a bit old. But I find it quite good anyhow. However, I got to a point ...
2
votes
0answers
576 views

Can thread ID be 0?

While traversing /proc/$PID/task/ directory, my program sometimes (rarely) comes across a subdirectory with name 0. After I notice this and check the directory, there's no such subdirectory already. ...
1
vote
1answer
694 views

Show running processes only — *not* threads

How do I show running processes for every user? Only the processes. I tried ps -e or ps -A, but it also shows the [ name ] which are threads.
3
votes
1answer
5k views

Does nproc in limits.conf refers to number of processes or number of threads?

If I want to check if I got to the max of the nproc value should I do: ps -ef | wc -l Or ps -efL | wc -l Does nproc in limits.conf refers to number of processes or number of threads?
0
votes
1answer
808 views

Multithreaded applications on a single threaded CPU?

The motivation behind this question arises from exploring the Intel Galileo gen2 board which has a single threaded processor. I'm looking for a conceptual explanation on what does that mean for all ...
-1
votes
1answer
90 views

Are there UNIX variants or other OS which make user level threads visible to OS kernel? [closed]

Are there UNIX variants or other OS which make user level threads visible to OS kernel ?