signals

How to pass data from a QDialog?

In Qt, what is the most elegant way to pass data from a QDialog subclass to the component that started the dialog in the cases where you need to pass down something more complex than a boolean or an integer return code? I'm thinking emit a custom signal from the accept() slot but is there something else? ...

SIGHUP equivalent in powershell

I am interested in knowing if we can catch SIGINT, SIGHUP equivalent signals in Powershell and how to do it? I also could not find if there is anything equivalent in powershell like "stty -echo" in unix environment. Thanks, ...

How to set a time limit on a function with a secure area

Hi, I'm trying to develop a program to time limit the execution of a function. In the code below I have a function named Inc which does a lot of iterations (simulated by the infinite loop). The first part of each iteration is quite long, followed by a second part that should be pretty fast. I don't mind preempting the execution while i...

How to guarantee signal delivery from multiple children

As part of a Linux benchmark application, I have a parent process that forks multiple children that will each perform a task in parallel. I'm using signals to coordinate between them since I'm looking for as accurate of timing as possible. Each child will prepare for the test, then enter a 'barrier' controlled by the parent via signals...

How to implement template class with template-dependent signal member from boost?

I try to implement a template class which requires to have a signal member that depends on the template argument. My first idea was to realize it like the following: template<class T> class SignalClass { typedef boost::signals2::signal<void (T &)> OnReceive; public: SignalClass(const OnReceive::slot_type &_slot) { m...

How to import the Python async module from a worker thread?

I'm using the GitPython package to access a Git repository from Python. This pulls in the async package. In async/__init__.py, the following happens: def _init_signals(): """Assure we shutdown our threads correctly when being interrupted""" import signal # ... signal.signal(signal.SIGINT, thread_interrupt_handler) _init...

What happens in Eclipse CDT on Linux if you press the Terminate button?

I guess some signals will be sent to the process. Some or one? If more than one in which order do they occure? And what happens if the Terminate button is pressed and if the process has forked? And what happens if the process has started other processes by system(...)? ...

How do Boost Bind, Boost Function, Boost Signals and C++ function pointers all relate to each other?

As the title might convey, I'm having problems seeing how Boost Bind, Boost Function, Boost Signals and C++ function pointers all play together. From my understanding, Boost Bind and Boost Function in conjunction work like Signals while Signals is an abstraction above Bind and Function. Also, compared to standard C++ function pointers...

Why is there no uncatchable coredump signal?

I recently came across an app that froze in a SIGABRT handler with no other signal registered to immediately core dump. Until we standardize leaving one of SIGSTOP, SIGABRT, SIGTRAP, etc., alone, we'll just use gcore and SIGKILL, but given that broken handling was the issue, I wondered why there isn't along with SIGSTOP and SIGKILL a st...

How do I send a signal to Perl on Windows?

I have some perl code which establishes a signal handler: $SIG{'KILL'} = sub { .... }; I'm tasked with porting this to windows and I was wondering how I could generate this signal from a C# class. I saw the Process.Kill method in the System.Diagnostics.Process class which seems to allow me to create (via another method) and kill my p...

python 2.6.x theading / signals /atexit fail on some versions?

I've seen a lot of questions related to this... but my code works on python 2.6.2 and fails to work on python 2.6.5. Am I wrong in thinking that the whole atexit "functions registered via this module are not called when the program is killed by a signal" thing shouldn't count here because I'm catching the signal and then exiting cleanly?...

Forwarding signals to child processes.

I have a shell script that starts an ssh session to a remote host and pipes the output to another, local script, like so: #!/bin/sh ssh user@host 'while true ; do get-info ; sleep 1 ; done' | awk -f parse-info.awk It works fine. I run it under the 'supervise' program from djb's daemontools. The only problem is shutting down the daemon...

PyQt_PyObject equivalent when using new-style signals/slots?

Hi. So I have a need to pass around a numpy array in my PyQt Application. I first tried using the new-style signals/slots, defining my signal with: newChunkToProcess = pyqtSignal(np.array()), however this gives the error: TypeError: Required argument 'object' (pos 1) not found I have worked out how to do this with the old-style signal...

Implement a userEdited signal to QDateTimeEdit?

QLineEdit has a textEdited signal which is emitted whenever the text is changed by user interaction, but not when the text is changed programatically. However, QDateTimeEdit has only a general dateTimeChanged signal that does not distinguish between these two types of changes. Since my app depends on knowing if the field was edited by th...

Django post save signal add an object into a manytomanyfield on the sender instance

I am using a post_save signal on an instance. In the callback I would like to add elements to the ManyToManyField of this very instance (named 'locales'). Here is my code: def after_insertion(sender, instance, **kwargs): locale = Locale(locale='en') locale.save() instance.locales.add(locale) Locale instance is created but...

How to stop python from propagating signals to subprocesses?

I'm using python to manage some simulations. I build the parameters and run the program using: pipe = open('/dev/null', 'w') pid = subprocess.Popen(shlex.split(command), stdout=pipe, stderr=pipe) My code handles different signal. Ctrl+C will stop the simulation, ask if I want to save, and exit gracefully. I have other signal handlers ...

Passing Arguments with Newstyle signals in PyQT

I've been having some trouble with a set of dynamically created buttons in PyQT. I'm using a list to create buttons corresponding to different values. Because each button is different, I need to have them pass an argument to the "Button Clicked" function identifying themselves separately so I can perform different actions with them. He...

Adding signal handler to a function in C for a thread library

I am writing a basic user level thread library. The function prototype for thread creation is thr_create (start_func_pointer,arg) { make_context(context_1,start_func) } start_func will be user defined and can change depending on user/program once after creation of thread, if I start executing it using swapcontext(context_1,context_2...

Basic signal handling in C++

This is a pretty basic scenario but I'm not finding too many helpful resources. I have a C++ program running in Linux that does file processing. Reads lines, does various transformations, writes data into a database. There's certain variables (stored in the database) that affect the processing which I'm currently reading at every iterati...

C++ - Clutter 1.0 - calling function from thread causes segfault

Hello! I am struggling with calling a clutter function from an extra thread. I use boost::thread for threading and the clutter library 1.0. To be specific, the thread contains a looped function that emits boost::signals2::signal with parameters of x and y coordinates every once in a while. That signal is connected to a function that ha...