In my program, I need to write file in kernel space due to some special reason although I know it’s not recommended. I’m using vfs_write to write files in kernel space and it works fine. In one case, there are two threads need to write to the same file. From the internet, it seems that user-space write is thread safe,
Tag: multithreading
How to catch new thread in gdb console mode?
I am running my Qt app from gdb, and i want to stop when new threads creates. (when gdb prints message [New Thread address (LPW number)]. I have set breakpoint b __pthread_create_2_1. That allows me to catch most of new threads prints. but i still got few new threads that are not catched. What else can i do to catch
Difference in behaviour between code executed by a pthread and the main thread in x64-assembly
When writing some x64 assembly, I stumbled upon something weird. A function call works fine when executed on a main thread, but causes a segmentation fault when executed as a pthread. At first I thought I was invalidating the stack, as it only segfaults on the second call, but this does not match with the fact that it works properly
How to create light weight kernel thread?
When I create a kernel thread (kthread_run), it becomes a new process.(I could see it using top command) . How can I create a light weight kernel thread(like the one we have in user space)? If I am not wrong, kthread_create will eventually call fork() which will call clone() with appropriate configuration to create a new process/lw process. Is it
RPi2, OpenMAX, Deadlock
Environment Raspberry Pi 2 B+ Debian Linux OpenMAX IL Use-case OpenMAX Camera Video capture Camera ports are disabled Renderer / Camera Tunnel is set All components state is set to Idle Ports are enabled Problem description The first port being enabled to the Camera Input port ( Port #73 ), the port is being enabled using the “OMX_CommandPortEnable” command, as
Why can only async-signal-safe functions be called from signal handlers safely?
I am still a little confused as to why exactly it is unsafe to receive a signal and call a non async safe function from within that signal handler. Could someone explain the reasoning behind this and possibly try and give me some references that I can follow to read up more on this myself? In other words I am
pthread_cancel and cancellation point
I’m learning the pthread_cancel function and testing whether thread would be cancelled when it doesn’t reach cancellation point. Thread is created by default attribute and make it running in add loop. But when cancellation request was sent and thread exit immediately. It doesn’t reach cancellation point and I think it should not respond to the request immediately. Answer To have
Many-to-one mapping of user threads to a kernel thread
As I understand it, in many-to-one mapping, one kernel thread manages many user threads. This kernel thread helps the user threads make system calls etc. What I don’t understand is: Why do we have many-to-one mapping if a single blocking call would block all user threads managed by the kernel thread ? In many-to-one mapping of user threads to a
Linux – Get the start and end of the stack memory for a thread
I am trying to port something to Linux. My original code (for a RTOS) looks like: Later the stack and stackSize are used by the garbage collector and to get some thread statistics. Now, how do I convert the above code to Linux? Answer You should use Pthread: http://www.manpagez.com/man/3/pthread_attr/ http://www.manpagez.com/man/3/pthread_create/