signal

What is the best way to make a thread signal another thread in .NET?

I need to have a thread signal another if the user wishes to interrupt execution, however I'm unsure about how to implement the signaling/signal-checking mechanism. I wouldn't like to have a singleton in my project (like a global bool), but is there an alternative? In this thread people suggest proper structures for that in C++, but I d...

Signal fires twice from gtkmm popup list

It's been a while since I used GTK+, and the last time I did was in C, not using gtkmm and C++ as I am now. Anyway, I have what I think should be an easy problem to solve: I have a popup menu consisting of a list of radio buttons, and when I click one of them I want some action to occur. The code goes like this: Gtk::RadioMenuIte...

Can I ignore a SIGFPE resulting from division by zero?

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

signal when user kills process?

I overloaded the 6 signals listed on this site http://www.cplusplus.com/reference/clibrary/csignal/signal.html Then i ran my app (double click not ran through IDE) and tried 1) end task 2) X on topright and 3) kill process. I expected the first two to cause some kind of signal (i am on XP) but alas i got nothing. Am i not allowed to ope...

Not able to catch SIGINT signal while using select()

I had defined my own signal handler for SIGINT. But my signal handler doesn't get called The signal handler just terminates the program. But on pressing ctrl+c, the program doesn't quit. Please help... This is how the code looks.. sa.sa_handler = handle_termsig; sa.sa_flags = 0; sigemptyset(&sa.sa_mask); sigaction(SIGINT, &sa, 0); si...

how to send signal from one program to another?

i am using message queue as an ipc between 2 programs. Now i want to send data from one program to another using message queue and then intimate it through a signal SIGINT. I dont know how to send a signal from one program to another . Can anybody pls provide a sample code if they have the solution. ...

Who "Killed" my process and why?

My application runs as a background process on Linux. It is currently started at the command line in a Terminal window. Recently a user was executing the application for a while and it died mysteriously. The text: Killed was on the terminal. This happened two times. I asked if someone at a different Terminal used the kill command ...

Test cases in C for WIFSIGNALED, WIFSTOPPED, WIFCONTINUED

I'm playing with waitpid() and signal() and I'm looking for reliable test cases for returning WIFSIGNALED(status) = WIFSTOPPED(status) = WIFCONTINUED (status) = true but can't find any... Care to tell me how can I make sure those return true so I can debug my code? Also, a few hints about what signals should I catch with signal() to te...

Handling User-Break (UART Break) on a /dev/tty device in Linux

Here is some code sample, but the issue is that the signal handler is not called when a 'break' is sent over the serial line with 'putty'. #include <sys/ioctl.h> #include <termios.h> #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <sys/signal.h> #include <errno.h> #include <sys/types.h> #inclu...

Print to log a core dump file stack, C++ over windows?

When my process crashes, how can I print to log a core dump file stack, C++ over windows? I know that in Unix there is a way to do it using some signal handlers but never did it myself. How can I do it in windows (prefer not to use ACE)? Thanks. ...

How to programmatically select the BT device to push a file to?

Hi, I am designing an information kiosk and need a BT application which can automatically push a file to the nearest BT enabled device assuming that this would be the phone of the person currently standing in front of the kiosk. Is there any other ways of doing this except by checking the RSSI (Received Singal Strength Indicator)? Do...

Explain the FFT to me

I want to take audio PCM data and find peaks in it. Specifically, I want to return the frequency and time at which a peak occurs. My understanding of this is that I have to take the PCM data and dump it into an array, setting it as the real values with the complex parts set to 0. I then take the FFT, and I get an array back. If each ...

Programmatically getting the iPhone's carrier signal strength

Hi all, Is there a way to get the iPhone's carrier, and/or the current signal strength, using Objective-C? I know how to determine if a data connection is present, and whether or not that connection is wi-fi vs. cellular. I also know that you can manually place the iPhone into "field test" mode by going to the phone app, and dialing #...

Algorithm to Match Time Dependent (1D) Signals

Hi, I was wondering if someone could point me to an algorithm/technique that is used to compare time dependent signals. Ideally, this hypothetical algorithm would take in 2 signals as inputs and return a number that would be the percentage similarity between the signals (0 being that the 2 signals are statistically unrelated and 1 being...

How to connect a slot to signal QProcess::started() ? QT

Edit: Solved. Hi, I'm starting with QT, I try to connect a slot to signal QProcess::started() but can't. QObject::connect() returns false. Any idea what am I doing wrong? Here's part of the code: class foo : public QObject { public: QProcess *process; public slots: void process_started(); } foo::foo() { process = new QPro...

Signal handling using "TERM"

Hai I have a standalone application in which I have to prompt the user with an confirm dialog box to save the changes made by him when he tries to shutdown the system by start-->shutdown. I came to know that by using signalhandlers we can do it. Can some one help me how to use signal handlers Thanking you chaithu ...

Perl: Blocking signal NOT delayed as it should be -> Test code provided.

In a Perl script I'm writing I'm having a problem where I block the INT and QUIT signals, execute a process within backticks, and then unblock the INT and QUIT signals. I want to prevent an INT or a QUIT from reaching the child process and killing it. The script successfully blocks and unblocks at the right points in the code, however...

c alternative to signal() + alarm()

I'm building some FastCGI apps and it sort of bugs me that lighttpd doesn't kill them off after they've been idle, so I'm trying to have them close on their own. I tried using signal(SIGALRM, close); alarm(300); and having the close function execute exit(0), and that works almost well. The problem is the close function is being call...

Why can I not import the Python module 'signal' using Jython, in Linux?

I can't find any reference to the 'signal' class being left out in Jython. Using Jython 2.1. Thanks ...

pthreads : pthread_cond_signal() from within critical section

I have the following piece of code in thread A, which blocks using pthread_cond_wait() pthread_mutex_lock(&my_lock); if ( false == testCondition ) pthread_cond_wait(&my_wait,&my_lock); pthread_mutex_unlock(&my_lock); I have the following piece of code in thread B, which signals thread A pthread_mutex_lock(&my_lock...