473,406 Members | 2,816 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

signals blocking

Dear All,
I have some a program in which I link a static library. The static
library has a initialize() and uninitialized() function.
Now when I call the initialize function a thread is being started up
and it makes use of the linux timer and start sending signals in a
certain frequency. This is a problem as when I use the getch()
function I see that something is being written continuously to the
console, which is not a satisfactory behavior for my program as in the
program I want to ask the user for certain inputs. I am not familiar
with signals in C but I was wondering if there is anyway to block
those signals.
Many thanks in advance for trying to answer my question.

RR
Jun 27 '08 #1
2 1538
wo*********@yahoo.com wrote:
Dear All,
I have some a program in which I link a static library. The static
library has a initialize() and uninitialized() function.
Now when I call the initialize function a thread is being started up
and it makes use of the linux timer and start sending signals in a
certain frequency. This is a problem as when I use the getch()
function I see that something is being written continuously to the
console, which is not a satisfactory behavior for my program as in the
program I want to ask the user for certain inputs. I am not familiar
with signals in C but I was wondering if there is anyway to block
those signals.
Many thanks in advance for trying to answer my question.
This is a question which cannot be satisfactorily answered without more
details. Which signal is being sent to the program? Is there a handler
for the signal? What behaviour does the program currently exhibit? Are
you sure it's the signal that's responsible for writing something to
the console? And what exactly is being written?

Also just about any use of signal requires varying amounts of
implementation specific support and guarantees, which means that your
question (with appropriate details and sample code if possible) is
better posted to a group specific to your system like
comp.unix.programmer or comp.os.linux.development.apps or something
related.

Even otherwise more details are needed before anything useful can be
said.

Jun 27 '08 #2
On 22 Apr 2008 at 16:13, wo*********@yahoo.com wrote:
I have some a program in which I link a static library. The static
library has a initialize() and uninitialized() function.
Now when I call the initialize function a thread is being started up
and it makes use of the linux timer and start sending signals in a
certain frequency. This is a problem as when I use the getch()
function I see that something is being written continuously to the
console, which is not a satisfactory behavior for my program as in the
program I want to ask the user for certain inputs. I am not familiar
with signals in C but I was wondering if there is anyway to block
those signals.
If you really mean that the thread is sending SIGALRM signals to your
process, then yes, you can block them by changing the disposition for
this signal to ignore:

#include <signal.h>

signal(SIGALRM, SIG_IGN);

(Blocking the signal on a per-thread basis is more complicated: you need
to use sigaction() and alter the signal mask. Ask if you want details of
that.)

However, you probably don't want to do that: it's quite likely that the
library isn't just pointlessly sending signals to your process: it will
have installed a signal handler and be doing something useful in the
handler function. Unfortunately, it also seems to be doing non-useful
things, like writing junk to stdout or stderr. There's not much you can
do about that except looking for a "quiet" or "silent" option you can
give the library.

Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Isidro Vila Verde | last post by:
Greetings, I need to handle signals to close some excel applications that my script open, when the script is killed by another process. My script is a little bit complex, but I wrote just two ...
4
by: Gabriele Bartolini | last post by:
Hi, I am writing an application in C++ on Linux, using threads (this is my first experience with pthreads). The application itself is fine, it is just that I wanted to handle asynchronous...
1
by: Leo Kirch | last post by:
Hello XSLT gurus, i've got a rather difficult problem. Some explanations first. theres a signal oriented xml-file - the graphical represantation looks like: | startsignal (signal00) \...
4
by: maxmagna | last post by:
Hello, I am looking for material that describes how *precisely* UNIX-based signals interact with the normal C++ execution flow of control and guidelines on how to treat signals in an...
4
by: bill | last post by:
I see this (or similar) question occasionally looking back through the archive, but haven't yet seen a definitive answer, so I'm going to ask it again. Consider the following: while True:...
0
by: Arnaud Debaene | last post by:
Hello all. I've got a bunch of existing, non managed, C++ DLLs that export types with, among other things, public events implemented using the boost::signals library. Now, I need to have...
6
by: geoffbache | last post by:
Hi all, I have a Python program (on UNIX) whose main job is to listen on a socket, for which I use the SocketServer module. However, I would also like it to be sensitive to signals received,...
11
by: vippstar | last post by:
What is the purpose of signals and why do they exist in C? thanks in advance
0
by: Tim Golden | last post by:
Lowell Alleman wrote: Well you've certainly picked a ticklish area to run into problems with ;). First, forget about the threading aspects for the moment. AFAICT the smallest program which...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.