General :: Create A Signal Handler Thread To Handle SIGALRM Signals?

Jan 19, 2010

I'm trying to create a signal handler thread to handle SIGALRM signals. The main thread calls the following function before creating any other threads

Code:

pthread_t Timer::Init(long _clock_interval_musec)
{
// Set interval.
clock_interval = _clock_interval_musec;
// This is called while in a single threaded environment.

[code]....

clock_interval is 50.

Is the timer not firing? Did I not set my interval correctly? Did I not proper block the signals ensuring the that the default handler would not take care of them?

View 7 Replies


ADVERTISEMENT

Programming :: Catching Multiple Signals In A Single Handler In C?

Apr 26, 2011

Is it possible to handle multiple signals in just one handler? I only know singal() catches one signal at a time

View 2 Replies View Related

Programming :: Possible To Connect A Signal Handler To A Variable?

Nov 1, 2010

Is it possible to connect a signal handler to a variable?So when the variable changes the signal handler is called.I have a vector containing strings which i want to parse when there are one or more available strings in the vector

View 3 Replies View Related

Debian Programming :: Serial Port Signal Handler

Jan 14, 2015

Basically I'm intending to write serial RX signal handler.Application receives defined packages of data over serial which contains header and payload. Handler should analyse incoming stream and upon detection of header (header is 6B in length) switches to receive payload of length defined in header, then after receiving full message packs it and sends to application for handling.Problem I'm facing is that at random moments in signal I receive errors that "Resource temporarily unavailable" while reading from ttyOx device and I see that sometimes I miss incoming data.Also is it possible that if while I'm handling signal one more signal arrives and it is started to be handled parallel? If it is, what are the ways to prevent it? So I would be sure that no more signals will fire on same peripheral until I will finish handling what I have on my hands now.

Serial open and init:
Code: Select allint open_port(int port_nr) {
    int fd; /* File descriptor for the port */
    switch (port_nr) {
    case 1:
        fd = open("/dev/ttyO1", O_RDWR | O_NOCTTY | O_NDELAY);
        break;
   
[code]....

View 5 Replies View Related

Programming :: Locking Mutex In A Signal Handler Function?

Feb 15, 2010

locking mutex (phtread_t type) in a signal handler function (installed by function signal()) for Linux. It seems that if the mutex has been previously locked by another thread outside the signal handler function and then the signal handler function tries to lock it, the whole process hangs.

View 5 Replies View Related

Programming :: Designing A Signal Handler With Sigwait In UNIX?

Jan 20, 2010

I'm new to Unix and every signal handler algorithm I've seen is more or less a copy of what I'm trying to do.[URL] designing a signal handler with sigwait in UNIX?

View 1 Replies View Related

Programming :: Handle Keyboard Button Pressed Signal?

Jul 4, 2011

I'm learning Signals, and I have a question:

Is possible to make a handle when I press any of the keyboard buttons?

The SIGINT handles the Ctrl-C combination, but I want to handle if any keyboard button was pressed.

View 3 Replies View Related

Programming :: Create The Thread Which Runs Then Drops Out?

Mar 11, 2010

I hope someone can help me with this. I need to call the same thread multiple times, but only run one thread at a time. So what I do is create the thread which runs then drops out. Run the main loop and after some time pthread_create the same thread again. So in pseudo code

[Code]...

I always presumed if I run a thread and it reaches with a pthread_exit, then the thread was destroyed? However I've found that after I've created the thread several 100 times the programme crashes? So can anyone advise how I call the same thread over and over?

View 10 Replies View Related

Programming :: Create A Separate Thread For Program Which Basically Polls Using The Read Command?

Sep 28, 2010

I'm trying to create a separate thread for my program which basically polls using the read command. However this new thread seems to block the main thread, anyone know why this could happen.

In main I call this function pthread_create(&mainEventThread, NULL, GenericEventThread, NULL);

which calls
/*New threads start function */
void *GenericEventThread()
{
short int i, nError = -1;

[Code]...

I've used pthread_self to check that a new thread is being created, so why is the while loop in one thread blocking the main thread from running, I haven't used the join function anywhere in my code.

View 2 Replies View Related

Programming :: How To Bind Thread To Specific Thread In Multithread Application?

Dec 25, 2010

I am going to use "pthread_setaffinity_np" to bind a thread to a specific core. My application has two threads. I have used mutex to assign a specific id to each thread and then bind that thread to a core different from another core. but it seems that the os assigns both thread to one core.What should I do to bind each thread to a specific core?

View 4 Replies View Related

Programming :: Weird SIGALRM Segmentation Fault On 64bit?

Apr 17, 2010

I've got a weird segmentation fault on the ending 'retq' instruction of my alarm callback, as if "calling pointer size" mismatched the 'q' of the 64bit retq. I've been trying to understand this bug for a while and couldn't get a clue. This code worked well on 32bit Slackware/Ubuntu/Debian. It now crashes on my 64bit Slackware install. I've written a small test case script for those who want to try it :

Code:
#!/bin/sh
#test-sigalrm-pack.sh
# 64bit sigalrm segmentation fault test case package...
echo " * Generating source..."
cat>tst-sigalrm.cpp<<TESTSRC
//tst-sigalrm.cpp

[Code]...

Paste this script into a file (like "test-sigalrm-pack.sh") and execute it ( $ sh test-sigalrm-pack.sh ), it will generate a cpp file (the source) and another script file that use the kind of link I need (static link) in the current directory. Also in order to link you might want to create a symbolic link to you glibc files (see note in the build script), I don't know how to do that "universally" (without the symbolic link 'hack')

View 14 Replies View Related

General :: Set Handler Php Without Panel?

Feb 23, 2010

How can I set the handler without panel?

like when it's set to dso without panel

and next my qus is :

where is mod_cgi.so in whm panel ? i want edit this file but i can not found this file

View 1 Replies View Related

General :: Particular Command To Send Different Signals?

Mar 10, 2010

We all know how to kill multi process but if we want to send different signals to different process like to stop,-9,to hungup simultaneously at the same time then how we will do it,is there any particular command to do it.

View 1 Replies View Related

General :: Blocking Or Sleeping An Interrupt Handler?

Dec 2, 2010

Assume: 1) Multi-cpu environment 2) Process that gets interrupted, is the same process that executes the interrupt handler, so I guess technically nothing gets interrupted except what the process was doing before, but it is still executing as it is executing the handler. 3) There is no top or bottom half, when an interrupt takes place the handler is invoked, executes, then return from interrupt, simple as that.

Why would sleeping the handler (puts in sleep queue, context switch to next runnable process) be a bad idea?

View 1 Replies View Related

General :: Display With No Signals And Go In Sleep Mode After Update

Jan 24, 2010

Linux downloaded new updates and worked perfectly. Next time I started mint, just before the login screen appears display says No Signal and goes in sleep mode. I think that mint downloaded somekind of display driver update wich is not compatible with my driver card. I can't see desktop, I just hear the login sound and that's all. What should I do? I'm new with linux.

View 6 Replies View Related

General :: Select PHP Handler Module Per Virtual Host?

Oct 20, 2010

I would really like to install 2 or 3 PHP handler modules (suEXEC, FastCGI, etc) on a single server and assign which module should be used per virtual host or domain or whatever.

Is this possible?!
Could I get details?

View 1 Replies View Related

General :: How To Make A Runnable Thread?

Feb 11, 2011

I wrote a code .sh I want to make it a runnable thread.
Q1: How can I do that in Ununtu?

Q2: I put that file (x.sh) in the "Auto start" program.I choose start at "start up" but it open the code editor page.I want it to be run behind backgroun...Have I convert it to .exe firstly ?!

View 17 Replies View Related

General :: Make A Thread With A Poll?

Feb 25, 2010

Is there a way for members to make a thread with a poll? I've looked around and havent found how, but thought it is around here somewhere.

View 2 Replies View Related

General :: Contact Admins - Remove The Thread

Jul 2, 2010

remove the thread after some one tells me.

View 2 Replies View Related

General :: Difference Core And Thread In Processor?

Jun 1, 2011

Can someone explain to me about the "core" and "thread" in the processor.

1. What is core?
2. What is thread?
3. What's the difference between core and thread?

View 8 Replies View Related

General :: Will Proc / Cpuinfo Gives CPU Info Per Core Or Per Thread?

Jul 18, 2011

My CPU has 2 cores, so I can see two parts in /proc/cpuinfo.But, I want to know if CPUs that support Hyper-Threading (or similar tech), will /proc/cpuinfo give CPU info per core or per thread (or call it sibling)?I only know that Windows Task Manager will give CPU usage statistics per thread if the CPU supports HT.

View 2 Replies View Related

General :: Get List Of Thread Of Running Process Using C Api (in That Code)?

Jan 29, 2010

In short our required is that we are creating a share library which can be loaded by a process and that share library analysis the process which load it. Since share library is in address space of the process so I need to find out how many threads created by the process and what is status of their stack trace etc.

So I am looking for a way to get list of threads in running process.

View 1 Replies View Related

General :: Find URL Of Screenshot To Insert Into New Thread Or Post?

Mar 15, 2010

I know what the URL of a webpage is and how to find it, but can't figure out how to do it with the screenshot accessory in Ubuntu 9.10. It is easy to use the tool to capture the image of a desktop, but won't let me do anything with the URL to insert it into anywhere!

View 5 Replies View Related

General :: 1:1 - What's Meant By There Is Kernel Level Thread For Each Pthread Created

Mar 11, 2011

I have gone thorugh some documents about pthread (NTPL ) in linux 2.6 kernel. As per that linux uses 1: 1 threading model and for each user level thread there is kernel level thread. Pthread_create uses clone system call to create a LWP and the kernel could treat that as a LWP and do scheduling and all .( different from linuxthread). My question is what's meant by there is kernel level thread for each pthread created. Can I see the kernel level thread if I call pthread_create using ps .

What exactly meant by 1:1 .I mean for each user level thread there is kernel level thread . If I make a system call from a thread does the OS services that action via kernel thread ( created using kernel_thread () or some other way ) internally ..

View 1 Replies View Related

General :: Stop Thread By Using Commands - Process Shouldn't Disturbed

Feb 12, 2010

How to stop a thread by using commands? Other threads in that process shouldn't disturbed. Is it possible to do the same?

View 2 Replies View Related

General :: Handle Bindkey In Zsh?

Apr 8, 2011

There is not a lot of info on that command, I didn't find a manpage nor a info and not more than examples on the web. Is there any tutorial or info on internet?

View 2 Replies View Related

General :: How To Handle Warnings

Oct 15, 2010

I've been trying to understand issues that occur during a uClinux distribution build (so I can include such issues in a module I'm writing for students). My process has been to work through errors that occur due to missing packages, then remove the distribution and build it again to uncover what happens.One thing I notice is different sets of warnings within each iteration of making a new build. From the document here (URl...it states, "A typical warning involves a variable being used before its value has been set."

So my question: is there a way to verify that the issue throwing the warning has been resolved by the end of the make build?And, is running make build again an option or could this cause problems within the build directories or image?

View 6 Replies View Related

General :: Best Way To Handle Cluster Failover

Sep 30, 2010

We have setup a High Available Cluster on two RHEL 5.4 machines with Redhat Cluster Suite (RHCS) having following configuration.

1. Both machines have Mysql server, Apache web server and Zabbix server.
2. Mysql database and web pages reside in SAN.
3. Active machine holds virtual IP and mounted shared disk.
4. We have also included a script in RHCS which takes care of starting Mysql, Apache and zabbix server on the machine which turns active when cluster switches over.

The above configuration holds good if Active machine goes down as a result of hardware failure or Reboot. What if, If any one service say Apache/Mysql/zabbix running on active hangs or become unresponsive.How can we handle this scenario ? Please advice.

View 3 Replies View Related

General :: Get A Plugin To Handle *.zip Files?

Jan 18, 2011

Where to get a plugin to handle *.zip files

View 2 Replies View Related

General :: Handle Non-determinant Harddrive Assignments?

Dec 22, 2010

I recently installed another harddrive into my Arch Linux computer. The first time I booted up all worked fine. The next time I restarted my computer though I was greeted with a /dev/sda2 not found error.

See, basically sometimes my boot harddrive is sda and sometimes it's sdb. It appears to be completely random and I don't see any options for making it non-random in the BIOS. How do I fix this?

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved