Stack Exchange Network

Stack Exchange network consists of 174 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 [thread]

The tag has no usage guidance.

0
votes
2answers
17 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
32 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
35 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
24 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
3k 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
106 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
53 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
54 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
88 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
171 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
139 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 ...
19
votes
3answers
3k 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 ...
5
votes
1answer
1k 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
41 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
86 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
166 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
4k 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
75 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
530 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
0answers
226 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 ...
59
votes
7answers
13k 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
288 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
452 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.
1
vote
1answer
3k 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
539 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
57 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
374 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 ...
17
votes
4answers
4k 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 ...
2
votes
3answers
10k 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
97 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
1k 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 ...
0
votes
1answer
292 views

Multithreading (increasing the number of threads for the process)

I wonder if there is any way of adding thread to specific process just to prove that number of thread which are assigned to process can be changed by user. If so, how could I do that ? [root@195689 ...
5
votes
1answer
498 views

Does POSIX define context switch?

Is a POSIX context switch well-defined? Is it the same thing as switching threads in C? Can the C compiler generate everything for a context switch or is assembly programming still needed for a ...
1
vote
1answer
1k views

Understanding Linux Perf sched-switch and context-switches

I've been trying to enable context switch events on perf and use perf script's dump from perf.data to investigate thread blocked time. So far the only two recording options that seem to be helpful ...
0
votes
2answers
628 views

Sleep system call and its time parameter

Let's say that we are writing a C program that calls the sleep() function. For instance, by calling sleep(7), the calling thread would be put to sleep for 7 seconds. My question is: Will the thread ...
30
votes
3answers
46k views

Creating threads fails with “Resource temporarily unavailable” with 4.3 kernel

I am running a docker server on Arch Linux (kernel 4.3.3-2) with several containers. Since my last reboot, both the docker server and random programs within the containers crash with a message about ...
1
vote
1answer
498 views

Threads vs interrupts

What does it mean when threads are time-sliced? Does that mean they work as interrupts, don't exit while routine is not finished? Or it executes one instruction from one thread then one instruction ...
4
votes
2answers
5k views

How can I know thread names that run on specific core

I am working in Java code. My code makes specific Java threads run on specific cores. In this code, I give names to Java threads. I need a Linux command that enables me to know the threads' names that ...
1
vote
2answers
2k views

Number of Threads in Kernel

How can I get the number of threads in the kernel at specific sampling rate? I need to measure the utilization of the system directly by myself.
1
vote
2answers
6k views

'htop' process and threads cpu usage?

I'm observing a multi threaded process in htop in tree view. If I were to strip it just to the problematic part, it looks somewhat like this: CPU% bin/process 100 `- ...
4
votes
2answers
4k views

The program pstree and htop showing threads with unique PIDS. How is this possible?

I ran the program pstree -p 31872 which printed the following output: ruby(31872)─┬─{ruby}(31906) └─{ruby}(32372) The man page for pstree says: Child threads of a process ...
3
votes
1answer
686 views

Thread process in linux

I'm wondering about the "punishment" that occurs when a new thread is created. From my understanding of clone(2), NPTL (New POSIX Thread Library), CFS (Completely Fair Scheduler), when a new thread ...
2
votes
1answer
897 views

API Monitoring and Hooking

I am currently reading the "Malware Analyst's Cookbook and DVD". There is a chapter "Dynamic Analysis" and there are also some recipes about hooking and monitoring API calls of process but it is for ...
2
votes
1answer
12k views

Are lock, mutex, and semaphore for between threads or between processes?

I think lock, mutex, semaphore are used for synchronized multiple (threads or processes?) to access something simultaneously. Must this "something" be some shared memory between multiple (threads or ...
0
votes
1answer
342 views

Emacs windows, frames, server and clients: threads or processes?

From http://www.gnu.org/software/emacs/tour/ Emacs server Some people like to keep only a single instance of Emacs open and edit all their files in there. Doing this has a few advantages: ...
5
votes
2answers
20k views

Understanding the difference between pid_max, ulimit -u and thread_max

I am trying to understand the Linux processes. I have confusion on the terms pid_max, ulimit -u and thread_max. What exactly is the difference between these terms? Can someone clarify me the ...
9
votes
5answers
12k views

Threads vs (Forked) Processes

Linux applications generally fork then exec (with execve() ), but Java applications, and certain Apache MPMs use threading. If forking, uses the fork + exec to spawn a process, what is the high level ...
3
votes
1answer
7k views

Increasing nproc limit for a non-root user . Only effective by restart

I am increasing nproc limit for one of a development user account in my rhel6 system . After searching some rubust solution , I zerod at editing /etc/security/limits.conf with these two lines : ...
5
votes
1answer
8k views

What information can I find out about an eventpoll on a running thread?

Following on from a problem described in "How is it that I can attach strace to a process that isn't in the output of ps?" I'm trying to debug a process that hangs part way through. By using ...
3
votes
1answer
4k views

What exactly is the lwp and threads in solaris?

The book "Solaris Internals" says Solaris executes kernel threads for kernel-related tasks, such as interrupt handling, memory page management, device drivers, etc. For user-process execution, kernel ...