Questions tagged [signals]

1

votes
1

answer
150

Views

Don't send SIGINT on CTRL+C to child processes but don't ignore the signal itself

I'm trying to write a Task control program, very much like Supervisor. I run some programs from a config file and let them run in the background, while in the main process I read and execute other commands. Before fork()-ing, in the main process I call: sigaction(SIGINT, &the_handler, NULL); Where t...
Emil Terman
0

votes
0

answer
5

Views

Schroeder's backward integration

I need to calculate the decay time of a partial (sine wave). I'm trying to understand and replicate in Python Schroeder's backward integration reported in here and I can't figure out how to do it in any language because I'm not so confident in understand these measure in particular and I searched a...
BADWOLF
0

votes
0

answer
17

Views

Email in django not being sent

I have a simple django application and I am not understanding why email are not being sent In my settings file I have EMAIL_USE_TLS = True EMAIL_HOST = 'smtp.gmail.com' EMAIL_PORT = 587 EMAIL_HOST_USER = '[email protected]' EMAIL_HOST_PASSWORD = 'Mypassword' DEFAULT_FROM_EMAIL = 'From Email' but repl...
Augusto Peres
1

votes
4

answer
79

Views

C: select() - Signal interrupt

I'm writing a multithreaded server program in C that works with AF_UNIX sockets. The basic structure of the server is: Main thread initialize data structures and spears a pool of "worker" threads. Worker threads start waiting for new requests on an empty thread-safe queue Main thread listen on vario...
Alessandro Meschi
0

votes
1

answer
8

Views

Django smpt email backend slowing down performance

I'm developing/serving currently locally. I'm using django-admin for internal users to add items. I add in my signal code. My signal is post_save and it's purpose is to send an email to a user for approval. I test my signal using console.EmailBackend EMAIL_BACKEND = 'django.core.mail.backends.consol...
Rach Odwyer
1

votes
0

answer
8

Views

Need help in using Signals with Python Flask

I am new to Python Flask and need some information/basic knowledge on how to use Signals with Flask. My understandig so far: I can create and send own signals. I can use this signal, to make a function call. My Flask Application looks something like this: @app.route("/") def start(): return render_t...
Rasid Music
1

votes
2

answer
195

Views

sudo ignores SIGTERM sent from same script

I'm trying to figure out why this doesn't work: #!/bin/bash sudo sleep 60 & sudo_pid=$! sudo kill $sudo_pid I'd expect that after the kill, the sudo command and its child sleep process would be terminated, but they aren't, as shown by this script: #!/bin/bash sudo sleep 60 & sudo_pid=$! sudo kill $s...
Jon
1

votes
0

answer
15

Views

Why is SIGINT and SIGTSTP not unblocking?

A bit lost here. I'm implementing my own shell and one of the features I need to implement is to ignore ctrl+c and ctrl+z when there are no child processes running, but when there are child processes running (like sleep 5 for example), then it needs to kill those processes. I've managed to successfu...
doctopus
1

votes
1

answer
286

Views

Qt - Q_PROPERTY's NOTIFY signal not emited about MEMBER change

I have a private class member variable status and i want to emit a signal with its value everytime it changes. Therefore I use Q_PROPERTY and specify a signal with NOTIFY: #ifndef CAMERACONTROL_H #define CAMERACONTROL_H #include #include class CameraControl : public QObject { Q_OBJECT Q_PROPERTY(Q...
goulashsoup
1

votes
2

answer
86

Views

Why was default SIGPIPE handler changed?

I'm working on a test and i'm asked how to make a "read" sleep or a "write" stop a process" For the latter I don't understand why my sigpipe is, indeed raised, but isn't stopping the process: #include #include #include #include #include #define READING 0 #define WRITING 1 #define DESCRIPTOR_COU...
Sheed
1

votes
1

answer
5.3k

Views

Difference between toggled and trigger in Qt?

What is the difference between the toggled and triggered signals in QAction? I don't know when to use one over the other or how they relate. Moreover, in the documentation for the triggered signal, what does "activated" mean? Is it the same as getting focus? Thank you...
Mr.Tu
1

votes
1

answer
721

Views

what is the relation between SIGTSTP and SIGCHLD

I have tow handlers for each one of them (SIGTSTP, SIGCHLD), the thing is that when I pause a process using SIGTSTP the handler function of SIGCHLD run too. what should I do to prevent this . signal handlers : void signalHandler(int signal) { int pid, cstatus; if (signal == SIGCHLD) { susp = 0; pid...
Rawhi
1

votes
2

answer
392

Views

Why my python SIGPROF doesn't work?

I am installing the SIGPROF signal and execute the handler every 2 seconds. Is there any problem? 1 #!/usr/bin/env python 2 #-*-coding: utf-8 -*- 3 #pylint: disable=W0141,W0613,W0603 4 5 import os 6 import sys 7 import signal 8 import time 9 10 def myhandler(signum, frame): 11 print "myhandler...
limi
1

votes
2

answer
1.1k

Views

signal a slot in another class in Qt

Situation: I have a Dialog class in Qt on which I draw a raster of squares. The squares are implemented in the MySquare class (MySquare: QGraphicsItem). Question: I want to signal the Dialog slot setTarget() that a square was clicked (and obviously I want to give it some information about that squa...
Thomas
1

votes
2

answer
552

Views

When does a process handle a signal

I want to know when does a linux process handles the signal. Assuming that the process has installed the signal handler for a signal, I wanted to know when would the process's normal execution flow be interrupted and signal handler called. According to http://www.tldp.org/LDP/tlk/ipc/ipc.html, the...
Achint Mehta
1

votes
4

answer
3.3k

Views

Is there a way to know what activated QAction?

I have created instance of QAction inside QGraphicsView child class and connected it to my slot in the same class. QAction *action = new QAction(tr("New"), this); action->setObjectName("addStopAction"); action->setShortcut(QKeySequence(Qt::ControlModifier | Qt::Key_N)); connect(action, SIGNAL(trig...
aksyr_
1

votes
1

answer
105

Views

weird signal received

I set up signal filter on my application as described here, except I block all the signals. sigfillset (&signalSet); And I receive weird signal #36 which is not described in public documentation nor in /usr/include/bits/signum.h. But, it looks like this signal affects sem_wait() in the main thread,...
D_E
1

votes
1

answer
870

Views

How to create a system of events through interrupts in python

Because of my zero knowledge about Python GUIs, I need some help, to make a mechanism for, Making requests through HTML,CSS or Ajax (node.js, Apache or nginx server) to a Python program to execute certain functions. For example, I have a python running a while True: loop, but at a given moment want...
user1629569
1

votes
2

answer
108

Views

When would a process raise a signal that causes itself to exit?

The cpp documentation states, It determines if the child process exited because it raised a signal that caused it to exit regarding the WIFSIGNALED function. What types of situation would cause the process to do such a thing?
Orca Ninja
1

votes
1

answer
840

Views

How to catch EINTR in Python?

My issue is caused (if I'm not wrong) by EINTR signal that cause raise of error while system call like select is performed. This issue is everywhere on the internet and there are solutions that are well described but all of them are not working for me. In multithread application I use many select ca...
lagoru
1

votes
2

answer
520

Views

Parent and child proc sync using signals

I have some troubles: it is not clear for me how to synchronise parent and child processes using signals, and this code doesn't work. I thought that it should work like that: parent sends signal to child, child's pause() is end, child sends signal to parent, parent's pause() is end .. etc why it is...
inaumov
1

votes
2

answer
796

Views

GDK signal, keypress, and key masks

I am trying to catch user key press Ctrl+d on a GUI window to quit. My code looks like this: static gboolean callback(GtkWidget *widget, GdkEventKey *event, gpointer data) { if(event->state == GDK_CONTROL_MASK && event->keyval == 'd') gtk_main_quit(); return FASLE; } This works on my laptop(Ubu...
lllluuukke
1

votes
1

answer
505

Views

Is it possible to interrupt a CUDA kernel from the host?

I would like to interrupt "gently" a running kernel, that is: send it a signal of some sort (via global memory?), let it do its cleaning stuff and return to host. I tried a simple program, using the *nix signal() function to change a bit on the global memory using a regular cudaMemcpy, but without s...
AkiRoss
1

votes
1

answer
1.9k

Views

QPushbutton does not connect

In the following code I'm trying to replace "original text" with "new text" when "click" button is pressed. I dont get any errors, but the label's text doesnt change. QPushButton *button=new QPushButton("click"); QLabel *label=new QLabel("original text"); QVBoxLayout *layout=new QVBoxLayout(); QStri...
g3nair
1

votes
1

answer
347

Views

Private QT signal

I have a data model that I want other objects to be able to watch for updates, but I don't want to give anyone control of the update signal itself. I've come up with a something that makes sense to me conceptually, but it doesn't seem to work. I'm wondering if anyone could explain why I will never g...
JeffCharter
1

votes
1

answer
295

Views

is there any limitation of how fast or how many times signals can be emitted in Qt?

i was experimenting with QThread the other day and i wanted to create an infinite loop by using signals only and not for, foreach or while but then my code would crash after emitting the signal and executing the slot for a number of times here's my code: //mainwindow.h #ifndef MAINWINDOW_H #define M...
Barracuda
1

votes
1

answer
690

Views

Issues with Qt's signals and slots behavior with multithreading

I'm currently trying to understand how signals and slots in Qt behave with threads. I've tried to run a small test with the following code: class Worker : public QObject{ Q_OBJECT public: Worker(int _value){value = _value;} ~Worker(){}; int value; public slots: void changeValue(int newValue){value =...
JBL
1

votes
3

answer
1k

Views

Race condition in signal handler with static variable

In a single threaded program, does a race condition is possible in a signal handler? void signal_handler(...) { static int i = 0; i = i + 10 * 10; } Imagine that two very close signals are thrown, so close that they enter the function at the same time. I can't find informations about how recent Linu...
Pierre T.
1

votes
1

answer
2.1k

Views

SIGALRM waits for subshell processes?

Here is the unexpected situation: in the following script, SIGALRM doesn't invoke the function alarm() at the expected time. #!/bin/sh -x alarm() { echo "alarmed!!!" } trap alarm 14 OUTER=$(exec sh -c 'echo $PPID') #for arg in `ls $0`; do ls $0 | while read arg; do INNER=$(exec sh -c 'echo $PPID') #...
sleepsort
1

votes
1

answer
3.3k

Views

Wait until button pressed(QT)

this is my first post on SO ^_^ I'm trying to implement a letter scramble game with QT framework. The main part is finished, but now i'm stunned - i can't figure out how to make program to wait for button to be pressed inside of a game. Please help me with it. Thanks in advance Here is pseudocode of...
whalex
1

votes
1

answer
914

Views

Django signal receiving across apps

I have a main_app, and app2. main_app is essentially a list of items with data, and app2 has more information about said items. main_app isn't supposed to know about app2, but app2 can import from main_app. Within main_app/signals.py, I have import django.dispatch mysignal = django.dispatch.Signal(p...
user2564502
1

votes
1

answer
71

Views

In Qt, what's the canonical approach to access signaling object from the slot function? (MVC design pattern)

I need to access the signaling object from the slot function in Qt. The reason being that I'm trying to keep the view and controller separate (implementing the MVC pattern), and the slot function, being in the controller class, has to update the view class to update a label. I realize there are seve...
daj
1

votes
1

answer
489

Views

Where goes wrong for this High Pass Filter in Python?

# Specifications for HPF Wp = 0.01 # Cutoff frequency Ws = 0.004 # Stop frequency Rp = 0.1 # passband maximum loss (gpass) As = 60 # stoppand min attenuation (gstop) b,a = fd.iirdesign(Wp, Ws, Rp, As, ftype='butter') y = sig.lfilter(b, a, x, axis=-1) I adjusted the parameters but the result never...
Sibbs Gambling
1

votes
1

answer
175

Views

Qt C++ - Connect multiple objects to one signal

I am trying to connect two QSpinBox into the range (max/min value) of a QSlider connect( ui->lowerFrameBox, SIGNAL(valueChanged(int)), ui->timeSlider, SLOT(setRange(int,int))); Is what I'm using at the moment, but of course it will not work because that only returns a single int. I need to either co...
Vii
1

votes
2

answer
519

Views

Boost.Signals deprecated

Boost.Signals is no longer being actively maintained, so it has been deprecated. Do not use Boost.Signals for new development (use Boost.Signals2 instead). If you have existing Boost.Signals-based code, it will continue to work, but consider moving to Boost.Signals2. http://www.boost.org/users/histo...
nyan-cat
1

votes
1

answer
2.2k

Views

Can not emit QThread's signals

QT 5.1.0rc2 , msvc 2010 , Microsoft Visual Studio 2010 It is working code on Qt 4.8.4 , msvc 2008 I have compile error at #if defined( HANDLE_PROCESSING_IN_MAIN_THREAD ) if(QThread::currentThread() != this) emit started(); #endif inherited::run(); and #if defined( HANDLE_PROCESSING_IN_MAIN_THREAD )...
Vlad Mikitich
1

votes
1

answer
210

Views

Using interrupt and continue signals in ruby

I have this program, that uploads photos to a database via an api. However, it takes quite a long time to process and upload all those images and I want to be able to stop and resume the process at random times. I thought the interrupt and continue signals might be good(temporary!) solution to this....
PericlesTheo
1

votes
1

answer
510

Views

Which signal can tell me unchecked checkbox?

Suppose i have set of QCheckBoxes, i set some of them.I need to understand when i uncheck them , But i don't know wich signal can help me? The folloiwng code tell me checked: QtCore.QObject.connect(self.checkBox, QtCore.SIGNAL(_fromUtf8("isChecked()")), lambda: self.interfaceCodesConstructor.setFilt...
PersianGulf
1

votes
2

answer
416

Views

MultiSelectable and Non Multiselectable checkboxes in Qt

I have written a simple widget, which has a list of QCheckBoxes. Also, my class has a member called isMultiselectable, which is initialized in the constructor. When this option is TRUE, I want the widget to be multi-selectable (i.e. the user can set more than one QCheckBox). Otherwise, it has to pre...
Karen Tsirunyan
1

votes
1

answer
716

Views

Python PyQt4 signal not firing connected method

I decided to use signals to indicate the completion of a thread. I wired the signal to code that restarts the process if more work still exists. Alas, the code connected to the signal never fires. This makes me sad. I need to know why the method 'Tester' in the code block below doesn't fire. I'm new...
bankai-code

View additional questions