Recently a machine was upgraded/reinstalled from an older Ubuntu version to the most recent Debian version. Since then, I get a segfault in an application I wrote which sends data to an icecast daemon. After some searching, I focused it down to threading. As soon as I call shout.send from inside a thread, I get a segfault. Below is a
Tag: multithreading
Who schedules threads?
I have a question about scheduling threads. on the one hand, I learned that threads are scheduled and treated as processes in Linux, meaning they get scheduled like any other process using the conventional methods. (for example, the Completely Fair Scheduler in linux) On the other hand, I also know that the CPU might also switch between threads using methods
Which thread handles the signal?
I have 2 threads(thread1 and thread2). And I have signal disposition for SIGINT. Whenever SIGINT occurs thread 2 should handle the signal. For that I wrote below program I compiled and and run the program. for every 1 second “thread1 active” is printing and for every 3 seconds “thread2 active” is printing. Now I generated SIGINT. But its printing “thread1
pthread_detach() causes SIGSEGV on 64 bit Linux
Here is a description of my situation: I have to take care of the bug in our product. The thread is created as joinable , it must do its work, terminate and nobody will call pthread_join() for it. So the thread is created with JOINABLE attribute (by default) and before termination it calls the next code: It works like a
Why priority inversion will happen in this case – Linux?
I have read many posts on priority inversion still I am not able to clarify my understanding on some of the parts. I would be happy if someone can throw some light on my question. Let’s describe the situation first. I have a pseudo code, that is self explanatory. I have a shared resource – int t; Here is the
Detecting number of CPU cores on Android from native code
I’m using sysconf( _SC_NPROCESSORS_ONLN ) (which, I believe, is the recommended way) to get the number of CPU cores. It works fine or Mac and Linux, but on my 4-core Android tablet it returns 2. How can I get the actual number of cores on Android from native code (without using JNI to call Java Android API)? Answer Neither sysconf(
Multithreaded Programming with Bash Script
I am running a bash script as like that: Every time when I send a request I have to wait to finish it and write to a file and after that it continues to looping. However I want to do it asynchronously. I mean that it will send a request and loop without waiting response. However when a response comes
One to one mapping of Java Thread to Linux thread (LWP)
Is there a one to one mapping between Java Thread objects and OS threads (Lightweight processes). That is, if I have a Thread object, can I always identify precisely one associated OS thread, and will I always have the same associated OS thread? In general this is OS and JVM dependent, so I’ll restrict the question to Linux with the
Is fopen() a thread safe function in Linux?
If I use fopen() call to open a same file in multi-thread, and write data to the file. Should I use a mutex to ensure the data won’t be disordered? Answer If two threads both open the same file with fopen(), they will each have independent file streams (FILE *) backed by independent file descriptors referring to the same file.
Which threading model is used by node.js? [closed]
It’s difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 9 years ago. When a new client connects to a server running node.js, does it use