Questions tagged [thread]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
24 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
24 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
6 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
38 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
77 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
66 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
138 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 ...
0
votes
0answers
43 views

Does the main thread of a given process have a Thread Control Block?

If there is a process with a PCB, consisting only of a single execution thread. Does this thread also appear as a TCB?
1
vote
0answers
163 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 *...
0
votes
0answers
27 views

understanding how threads are created inside linux operating system

I am currently studying on Linux operating system. My problem is with threads inside Linux. I know that every process has it own PCB of size 1KB inside the kernel and an additional 7KB stack ...
1
vote
0answers
52 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, ...
0
votes
0answers
24 views

Killing a thread in Python (which is descendant of current process) [duplicate]

Normally, Linux threads cannot be killed outside the main proces's scope, except by killing the main process itself, however, I need to do so. I made a threaded program which needs to have a complete ...
1
vote
1answer
37 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
68 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
152 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 ...
0
votes
2answers
234 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 ...
1
vote
2answers
324 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
285 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
347 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
35 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
99 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
0answers
29 views

How do you determine the priority of Linux system processes?

I've currently inherited some legacy code in which the user program spawns two threads running at priority level 49. Here's a snippet for one of the threads: SchedParam.sched_priority = 49; if(...
12
votes
1answer
4k 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
230 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
68 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
69 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
189 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
506 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
214 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 ...
21
votes
3answers
4k 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
3k 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
48 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
105 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
298 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
6k 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
86 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
829 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 ...
1
vote
3answers
1k 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
235 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 ...
61
votes
7answers
17k 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
400 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
579 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.
2
votes
1answer
4k 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
654 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
69 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 ?
0
votes
1answer
491 views

How are separate stacks for different threads allocated in kernel mode for a process in Linux Kernel?

If a system call is made for a process and sitting in kernel mode, if 2 threads are created then a)how are the stacks for each thread is created in kernel? b)If one of the thread switch back to ...
21
votes
5answers
6k views

How to renice all threads (and children) of one process on Linux?

Linux does not (yet) follow the POSIX.1 standard which says that a renice on a process affects "all system scope threads in the process", because according to the pthreads(7) doc "threads do not share ...
3
votes
3answers
12k views

Too many rcuos and rcuob processes in my VM

I am running CentOS 7.2 (3.10.0-327.18.2.el7.x86_64) as VMware guest with 2 cpu and 6 GB RAM on my Lenevo W540 iCore 7 having 32 GB RAM. I see 128 processes each for rcuos and rcuob in my VM. This ...
2
votes
1answer
127 views

Pthread scheduler scope variables?

I read that their is 1:1 mapping of user and kernel thread in linux What is the difference between PTHREAD_SCOPE_PROCESS & PTHREAD_SCOPE_SYSTEM in linux if kernel is considering every thread ...
4
votes
2answers
2k views

Status of a threads vs. status of a process

Do all threads of a specific process share the same status (D, R, S, ...) or may there be differences among these threads? If so, where in /proc do I find information about the status of a certain ...