signals

A signalling thread problem

Hello - I am attempting to get a thread running which will be responsible for detecting a signal from any other thread within the same process. sigset_t sigset; sigfillset(&sigset); pthread_sigmask( SIG_BLOCK, &sigset, &old ); Once i've done this, I then daemonize the process: m_child = fork(); if (m_child == 0) { // Start t...

C++ Signals/Slot: Slot processing and best C++ Signal library?

I currently have a program which use busy pooling and a bunch of thread to monitor states of object, process data, and pass data.. This is all very hard to manage/waste cpu time. I am looking at removing thread and using signal / slot as there is none of my code which "block". So I will signal states of my object, which is easy. What's ...

Fastest C++ Signal/Slot Lib without dependency

I am going to pass data up/down a 5-10 layered object using signals and slots. Which should result in a few thousand signal per sec. Which is far form "I clicked a button". All my object will also signal them self on a timer about every 100ms so they can do some processing. What would be the fastest C++ Signal/Slot implementation which ...

Catching signal inside its own handler

#include<stdio.h> #include<signal.h> void handler(int signo) { printf("Into handler\n"); while(1); } int main() { struct sigaction act; act.sa_handler = handler; act.sa_flags = 0; sigemptyset(& act.sa_mask); sigaction(SIGINT, &act, NULL); while(1); return 0; } After catching the KeyboardInterrupt on...

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

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 ...

QTableWidget signal cellChanged(): distinguish between user input and change by routines

i am using PyQt but my question is a general Qt one: I have a QTableWidget that is set up by the function updateTable. It writes the data from DATASET to the table when it is called. Unfortunately this causes my QTableWidget to emit the signal cellChanged() for every cell. The signal cellChanged() is connected to a function on_tableWid...

To catch or not to catch

Should application catch "bad" signals such as SIGSEV, SIGBUS? ...

Erlang Linux signal handling

Is it possible to trap Linux signals (e.g. SIGUSR1) through an handler in Erlang? (without having to resort to a driver crafted in C) ...

Calling a standard library function in signal handler.

Why is calling a standard library function inside a signal handler discouraged? ...

creating custom event / signal on cocoa os x

I am not much familiar with developing application using cocoa on mac. Can some one help me with how can i create custom events or signals, and how to make sure thread acts when these are generated or triggered. Any help will be appreciated. ...

Why do I get two clicked or released signals when using a custom slot for a QPushButton ?

here's the main code at first I thought is was the message box but setting a label instead has the same effect. #include <time.h> #include "ui_mainwindow.h" #include <QMessageBox> class MainWindow : public QWidget, private Ui::MainWindow { Q_OBJECT public: MainWindow(QWidget *parent = 0); void makeSum(void); ...

what is the mistake in my code

class myslot { public: Q_OBJECT myslot() { } ~myslot() { } typedef enum Emycars{volvo,benz,tata}cars; public slots: void hellowslot(myslot::cars); }; void myslot::hellowslot(myslot::cars cars1) { } class mysignal { public: Q_OBJECT public: mysigna...

Python: Script works, but seems to deadlock after some time

I have the following script, which is working for the most part Link to PasteBin The script's job is to start a number of threads which in turn each start a subprocess with Popen. The output from each subprocess is as follows: 1 2 3 . . . n Done Bascially the subprocess is transferring 10M records from tables in one database to diff...

Signal Handling in C

How can I implement signal Handling for Ctrl-C and Ctrl-D in C....So If Ctrl-C is pressed then the program will ignore and try to get the input from the user again...If Ctrl-D is pressed then the program will terminate... My program follows: int main(){ char msg[400]; while(1){ printf("Enter: "); fgets(msg,400,stdin); prin...

Need to understand Python signals and modules

I am trying to get up to speed with Python, trying to replace some C with it. I have run into a problem with sharing data between modules, or more likely my understanding of the whole thing. I have a signal module which simplified is: import sys, signal sigterm_caught = False def SignalHandler(signum, stackframe): if signum == signa...

Scanf with Signals

I have a signal that blocks SIGINT and basically says "Sorry, you can't quit.\n" The issue is this can occur during a scanf. When this occurs during a scanf, scanf takes in the printf as input. How can I do a printf that will cause scanf to basically hit the enter key automatically. I don't care that I am getting bad input. I just wan...

half-sine pulse shaping

hi, i wanted to know what is the pulse shape of the modem.oqpskmod? and if it is not half-sine pulse shape, how is it possible to make it half-sine pulse shape as it is stated in ieee 802.15.4(zigbee) standard where it shows it as follows p(t)=sin(pi*t/2*Tc) if 0<=t<=2Tc p(t)=0 if otherwise ? thanks a lot! ...

How to detect defunct processes on Linux?

I have a parent and a child process written in C language. Somewhere in the parent process HUP signal is sent to the child. I want my parent process to detect if the child is dead. But when I send SIGHUP, the child process becomes a zombie. How can I detect if the child is a zombie in the parent process? I try the code below, but it does...

detect sender of signal (linux, ptrace)

Hello Can I distinguish signal, between delivered directly to a process and delivered via debugger. Case 1: $ ./process1 process1 (not ptraced) //set up handler alarm(5); .... //signal is handled and I can parse handler parameters Case 2: $ debugger1 ./process1 process1 (is ptraced by debugger1) //set up handler alarm(5);...

Can one class generate a signal and handled by another class?

Hello, I have a buffer in class 'bufferClass' that will generate a signal to tell 'fileClass' that buffer is full and now write data to file? And when 'fileClass' is done writing to file, it will generate a signal to tell 'guiClass' that data can be read from file. Is this possible? I have been reading http://www.gnu.org/s/libc/manual...