简体   繁体   English

Linux:实时信号

[英]Linux: Real-Time Signals

I am testing different scenarios with real-time signals and unable to found the meaning of every signal such as SIGRTMIN+1 and SIGRTMIN+13.我正在使用实时信号测试不同的场景,无法找到每个信号的含义,例如 SIGRTMIN+1 和 SIGRTMIN+13。

I am able to send and receive the signals but trying to understand the meaning of all the SIGRTMIN+n signals.我能够发送和接收信号,但试图理解所有 SIGRTMIN+n 信号的含义。 For example, I send number of Signals based on my program and one of them is killing a process:例如,我根据我的程序发送了多个信号,其中一个正在杀死一个进程:

/* The child process executes this function. */
void
child_function (void)
{
  /* Perform initialization. */
  printf ("I'm here!!!  My pid is %d.\n", (int) getpid ());

  /* Let parent know you’re done. */
  kill (getppid (), SIGUSR1);

  /* Continue with execution. */
  puts ("Bye, now....");
  exit (0);
}

I want to understand these SIGRTMIN+13, how does it work if I pass this to pass to kill a process forcefully.我想了解这些 SIGRTMIN+13,如果我通过这个传递来强行杀死一个进程,它是如何工作的。

real-time signals are designed to be used for application-defined purposes(it's up to you to give them a meaning),they have the advantage to be queued and accompanied with data which is not possible with standard signals, to use them effectively they are sent using sigqueue() "not kill()", and handled by sigaction() "not signal()".实时信号旨在用于应用程序定义的目的(由您来赋予它们含义),它们具有排队和伴随数据的优势,这是标准信号无法实现的,有效地使用它们使用 sigqueue() "not kill()" 发送,并由 sigaction() "not signal()" 处理。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM