get current-pid while in interrupt
You can, current->pid
exists and is the process that was interrupted (may be the idle thread, or any).
If you're writing inside the Linux scheduler, you should be very careful. current
is changed by the scheduler as it chooses a new process to run, so its value depends on when exactly you read it.
PID in case of irq context
It shows just a pid of a process that the IRQ preepmts.
You can imagine that:
- A process whose pid is 1001 is running.
- At that time, you press a key to raise an IRQ.
- The IRQ handler preempts the process whose
current->pid
is 1001.
There is NO RELATIONSHIP between current->pid
and the IRQ
how to handle a long interrupt without freezing the system
I finally found a solution for this. It is filp_close()
flush_cache_all() ;
close_result = filp_close(fdt->fd[i], NULL);
The whole system will not be frozen.
Thank you very much for your suggestions.
Regards
How to get the PID of matlab when using the MATLAB Engine?
Evaluate the following in MATLAB to get the PID:
feature('GetPid')
I found this here.
Related Topics
How to Query X11 Display Resolution
Is There an Acceptable Linux Targeted Gui Client for Git-Svn
How to Identify the Particular Linux Flavor via Command Line
Postgresql CSV Import from Command Line
Sharing One Port Among Multiple Node.Js Http Processes
Linux Mint - Adding Environment Variables Permanently
Linux Configure/Make, --Prefix
How to Align the Columns of a Space Separated Table in Bash
Linux Process in Background - "Stopped" in Jobs
Gcc Compiled Binaries Give "Cannot Execute Binary File"
Find and Replace a Particular Term in Multiple Files
What Is the *Nix Command to View a User's Default Login Shell
How to Run Script Commands from Variables