signals

What's the single best reference on the topic of (POSIX) signals?

妖精的绣舞 提交于 2019-12-10 17:51:43
问题 Signals seem to be one of those areas that should be conceptually simple and easy to explain but I have never come across one source that is both comprehensive, lucidly written, and up to date. In part this seems to be because of historical cruft, lots of exceptions to rules, different programming standards, the confusion threads throw into the mix, real-time additions, etc. What's your best written, most complete source on unix/linux/posix signals? Web sites, books, stone tablets, whatever,

How can i reshape my data for keras lstm input?

烈酒焚心 提交于 2019-12-10 17:35:56
问题 I'm new to Keras, and I find it hard to understand the shape of input data of the LSTM layer. The Keras Document says that the input data should be 3D tensor with shape (nb_samples, timesteps, input_dim). I have 808 signals. And each signal has 22 channel and 2000 data points. Data_shape : (808,22,2000) Also i have 808 labels for each signal. Label_shape : (808,2) Label[1,:] = [1,0] I want to analyze with slice 2000 data points into 20 time steps, and each time steps(lstm cell) receive 100

Is it possible to signal yourself in Node.js?

☆樱花仙子☆ 提交于 2019-12-10 17:13:26
问题 I know it's possible to send SIGTERM , SIGINT , etc. to your own process in the C programming language: https://www.gnu.org/software/libc/manual/html_node/Signaling-Yourself.html Does Node.js provide this functionality? 回答1: process.kill(process.pid, "SIGINT"); process.kill sends a signal ( SIGINT in this case, provided by the second parameter), to a provided PID. ( process.pid in this case, which is the PID of the running node process.) Source: https://nodejs.org/api/process.html#process

create and emit gtk signal

时光怂恿深爱的人放手 提交于 2019-12-10 17:01:36
问题 I am trying to create and emit a GTK signal: g_signal_new("child-finished", G_TYPE_OBJECT, G_SIGNAL_RUN_FIRST, 0, NULL, NULL, NULL, // *** I think this is where I need to change it G_TYPE_NONE, 0); g_signal_connect(G_OBJECT(myWindow), "child-finished", G_CALLBACK(MyCallback), NULL); Here is my code that emits the signal: gtk_signal_emit_by_name(referenceToMyWindow, "child-finished"); And here is my code that handles the signal: void MyCallback(GtkWidget *w, GdkEvent *e) { // handler code here

Signal handling in Pylons

…衆ロ難τιáo~ 提交于 2019-12-10 16:38:06
问题 I have a pylons project where I need to update some in-memory structures periodically. This should be done on-demand. I decided to come up with a signal handler for this. User sends SIGUSR1 to the main pylons thread and it is handled by the project. This works except after handling the signal, the server crashes with following exception: File "/usr/lib/python2.6/SocketServer.py", line 264, in handle_request fd_sets = select.select([self], [], [], timeout) select.error: (4, 'Interrupted system

Why linux decides that standard signals have higher priority than rt-signals? [closed]

ぃ、小莉子 提交于 2019-12-10 16:19:49
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . If both standard and real-time signals are pending for a process, POSIX leaves it unspecified which is delivered first. Linux, like many other implementations, gives priority to standard signals in this case. Literally,real-time signals have this name because it needs to be processed ASAP,almost real-time. But

Can I ignore a SIGFPE resulting from division by zero?

爱⌒轻易说出口 提交于 2019-12-10 16:17:13
问题 I have a program which deliberately performs a divide by zero (and stores the result in a volatile variable) in order to halt in certain circumstances. However, I'd like to be able to disable this halting, without changing the macro that performs the division by zero. Is there any way to ignore it? I've tried using #include <signal.h> ... int main(void) { signal(SIGFPE, SIG_IGN); ... } but it still dies with the message "Floating point exception (core dumped)". I don't actually use the value,

Do signal handers have a separate stack?

[亡魂溺海] 提交于 2019-12-10 15:55:37
问题 Do signal handlers have a separate stack, (like each thread have separate stacks)? This is in Linux/C context. 回答1: From the Linux manual page signal(7): By default, the signal handler is invoked on the normal process stack. It is possible to arrange that the signal handler uses an alternate stack; see sigaltstack(2) for a discussion of how to do this and when it might be useful. 来源: https://stackoverflow.com/questions/8179993/do-signal-handers-have-a-separate-stack

Return value from system() when using SIGINT default handler

£可爱£侵袭症+ 提交于 2019-12-10 15:29:15
问题 I am experiencing some strange return values from system() when a child process receives a SIGINT from the terminal. To explain, from a Perl script parent.pl I used system() to run another Perl script as a child process, but I also needed to run the child through the shell, so I used the system 'sh', '-c', ... form.. So the parent of the child became the sh process and the parent of the sh process became parent.pl . Also, to avoid having the sh process receiving the SIGINT signal, I trapped

Handling signals with gdb

杀马特。学长 韩版系。学妹 提交于 2019-12-10 15:20:57
问题 I'm debugging a C++ app for Ubuntu 10.04 that sometimes receives a SIGKILL signal. I want to catch the signal and stop it from killing the execution, just to see if I can get some useful info of the app's state at that precise moment. Reading the gdb documentation I found the handle command, so I tried to apply it to the SIGKILL signal: (gdb) handle SIGKILL stop nopass Signal Stop Print Pass to program Description SIGKILL Yes Yes No Killed So, as I understand this correctly: stop GDB should