I am bit confused with all this enteties and how they interconnected in Linux. “Unix internals” book states that lightweight process (LWP) is kernel-supported user thread, and that kernel doesn’t see threads inside processes. Is it stil true for Linux? As I understand, user-space threads scheduled inside process, by higher level abstraction as pthread library, without kernel’s intervention. Am I
Tag: multithreading
Adjust context switch frequency in Java on Linux
I’m looking into a potential concurrency issue in some binary Java code. The code sometimes has a strange behavior, but I’m not sure if it’s actually due to concurrency issues in the code itself, or if it’s something else. I haven’t been able to reproduce the strange behavior myself, but only seen it happening in our log files. Is there
Read/Write lock for linux kernel module
I’m trying to protect my list with data using read/write locks, i found solution in this thread: What’s the best linux kernel locking mechanism for a specific scenario But i can’t find needed headers for this solution, seems it is outdated, error: error: ‘RW_LOCK_UNLOCKED’ undeclared here (not in a function) Using <linux/spinlock.h> Answer RW_LOCK_UNLOCKED has been deprecated for a long
How to detect how often a button has been pushed consecutively?
I want to monitor the output of a command which keeps running infinitely and prints a line every now and then. It displays events of a hardware button and each line indicates a push. My script is supposed to run other commands when it receives lines, but the problem is that not the content of those lines decide which command
How costly is a low contention mutex in terms of cpu
I have some C code (on Linux) that needs to run in a thread safe manner. It’s very low contention but I have to guard it to ensure correctness. I have the option of using local variables to guard it (which will work based on how the code is written) but since I have a mutex variable, which is the
Understanding software parallelization on a linux workstation
Summary I am trying to understand the limits of my compute resources when performing multiple simulations. My task is trivial in terms of parallelisation – I need to run a large number of simple independent simulations, i.e. each simulation program does not rely on another for information. Each simulation has roughly the same running time. For this purpose I have
Subprocess doesn’t respect arguments when using multiprocessing
The main objective here is to create a daemon-spawning function. The daemons need to run arbitrary programs (i.e. use subprocess). What I have so far in my daemonizer.py module is: When trying to run this in bash (This will create a file called test.log in your current directory.): It correctly spawns a daemon that launches ping but it doesn’t respect
Improve MySQL Performance
Info: MySQL Community 5.7.12 64 bits Programming Language: Python 3.5 mysqld.cnf: Mysqld.cnf result of “show variables” show variables Description: – I have 200 000 tasks. – I process these tasks with 500 threads, one per task, when a thread finishes, another task start. The point of this is not to have more than 500 threads running. – I am creating
Segmentation fault (exit code 139) when using pthread_join
I’m doing some first steps with threads on Linux systems, and i have this error which occures on the base of a program that gets some n argument and creates n number of threads. Here is the important part of the code: The function the threads should run: Important part of code in the main function Notice the last for
POSIX timer hangs up after a few runs
I have created a POSIX timer in the main function of my program. Each thread of the main program is setting the timer so that on expiry of it, the signal handler update one variable which awakes the next thread of the same process. The timer is working fine most of the time but not always. It sometimes completes the