signals

How do I call a perl process that is already running from another script?

Problem: scriptA.cgi is sitting in an infinite loop and handling an open socket to a Flash client. scriptB.cgi is called from the web, does what it needs to do and then needs to inform scriptA to send a message to the client. Is this possible? I'm stuck on how to have scriptB identify the instance of scriptA that is sitting there with t...

Inter-thread communication. How to send a signal to another thread

In my application I have two threads a "main thread" which is busy most of the time an "additional thread" which sends out some HTTP request and which blocks until it gets a response. However, the HTTP response can only be handled by the main thread, since it relies on it's thread-local-storage and on non-threadsafe functions. I'm l...

Callback, specified in QueueUserAPC , does not get called

In my code, I use QueueUserAPC to interrupt the main thread from his current work in order to invoke some callback first before going back to his previous work. std::string buffer; std::tr1::shared_ptr<void> hMainThread; VOID CALLBACK myCallback (ULONG_PTR dwParam) { FILE * f = fopen("somefile", "a"); fprintf(f, "CALLBACK WAS IN...

How can I call a method in a running Perl process from another process?

Ok, so, I got the signal through but for some reason the process exists after it receives the signal. If I add an endless loop (while(1) ) before I even create the socket then it works as prescribed. So... something in my socket code is quitting when the kill command is issued. I don't see what it would be though. Without the kill, ...

gdb causes sem_wait() to fail with EINTR error

After switching from Ubuntu to CentOS 5.4 we came across a strange GDB behavior. Running application in debugger causes sem_wait() to return several (5-10) times with EINTR error. I installed the latest GDB version but it did not solve the problem. I suppose this is cause by some signal sent by GDB but I could not get any info in signal ...

Can I set the Linux SIGUSR1 from within the kernel?

Hi All, I might be approaching this all wrong but... I have a linux kernel device driver that handles an external interrupt and currently performs a printk() when it occurs. What I would like to do is tell a user space app that this event has occurred so it can wake up and do some stuff. Is it possible (/simple /good practice) to s...

Linux: multiple-SIGIO problem (async serial communication)

Hi all. I'm esperiencing a SIGIO-related problem in a C++ program I'm working on. Platform: Linux 2.6.30, x86 Arch Scenario: async serial communication. I followed this async-communication example from the Linux Serial Programming HowTo and it worked flawlessy. Then I removed the "sleep+check wait_flag" thing and now I handle the r...

Are open streams automatically flushed and closed on SIGINT in C?

I've read in a man page that when exit() is called all streams are flushed and closed automatically. At first I was skeptical as to how this was done and whether it is truly reliable but seeing as I can't find out any more I'm going to accept that it just works — we'll see if anything blows up. Anyway, if this stream closing behavior is ...

How to disable shell interception of control characters?

Hi. I'm writing a curses application in Python under UNIX. I want to enable the user to use C-Y to yank from a kill ring a la Emacs. The trouble is, of course, that C-Y is caught by my shell which then sends SIGTSTP to my process. In addition, C-Z also results in SIGTSTP being sent, so catching the signal means that C-Y and C-Z are not...

RF Transceiver and GPhone

does GPhone have RF Transceiver? I want to receive data from a nRF2401A Transceiver - The Nordic Semiconductor nRF2401A ultralow power 2.4GHz transceiver is this possible? ...

Where are core dumps written to in Mac OS X?

On Mac OS X, if I send SIGQUIT to my C program, it terminates, but there is no core dump file. Do you have to manually enable core dumps on Mac OS X (how?), or are they written to somewhere else instead of the working directory? ...

How can I notify the main thread of some message on another thread without blocking and waiting?

I'm writing a c# component that will only be used internally at my company. The component encapsulates communication with a number of servers that particular desktop applications need to communicate with. The servers can send unsolicited messages to the component, which are 'caught' in a separate thread. I want the majority of this comp...

PyQt4,How to add a batch of widget (QPushButton) at one time and lets them to execute on SLOT

if i want to add 10 QPushButton at one time: NumCount=20 for i in range(NumCount): btn=QPushButton("%s %s" %("Button" i+1),self) btn.clicked.connect(self.btnclick) def btnclick(self): # here is my question # how to define which button clicked? # how to print btn.text? as stated in the def(btnclick). ...

DBus Glib Send Signal - No signals being emitted.

I am attempting to send a signal out over the session message bus. I am able to call methods fine using d-feet dbus debugger with no problem. Unfortunately d-feet does not allow you to connect to signals to debug those. In replacement I am using dbus-monitor "type='signal'" to see if anything is sent. So far this works except for anythin...

private/public qt signals

can qt signals be public or private? Can I create internal signals, which are seen only inside the class? added: I have a class with some internal signals. How can I make those signals invisible for other classes (encapsulation & information hiding) thanks in advance, anton ...

are glib signals asynchronous?

When using glib to dispatch signals through emit, are all the "listeners"/handlers called back-to-back or is control relinquished to the event loop after each listener/handler? ...

Signal handling in Python

In my program I have a bunch of threads running and I'm trying to interrupt the main thread to get it to do something asynchronously. So I set up a handler and send the main process a SIGUSR1 - see the code below: def SigUSR1Handler(signum, frame): self._logger.debug('Received SIGUSR1') return signal.signal(signal.SIGUSR1, Si...

No such signal QTableWidget::cellChanged(int, int)

The title describes my problem quite well. The offending line of code: connect(table, SIGNAL(cellChanged(row, 5)), this, SLOT(updateSP())); I can think of no reason why that signal is not valid. I googled around, and found a couple people with the same problem, but the solutions posed there don't work. I'm using Qt 4.5.2 on Ubuntu ...

What does g_signal_connect_swapped() do?

According to GObject reference g_signal_connect_swapped(instance, detailed_signal, c_handler, data); connects a GCallback function to a signal for a particular object. The instance on which the signal is emitted and data will be swapped when calling the handler. I don't quite get what this means. Does this mean that the data will ...

How to select on STDIN_FILENO ignoring signals?

Please check the following code #include <stdio.h> #include <string.h> #include <stdlib.h> #include <termios.h> #include <unistd.h> #include <sys/types.h> #include <signal.h> #include <sys/time.h> #include <time.h> #define CLOCKID CLOCK_REALTIME #define SIG SIGRTMIN int reset = 0; void changemode(int); int kbhit(void); int pfds[2]; s...