473,387 Members | 1,502 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,387 software developers and data experts.

Waking up a POSIX thread with a signal

60
Hi Guys,

I am very new to pthreads. I have two pthreads, the writer and the reader thread. I want to be able to wake up the reader thread with SIGUSR1 after writing to the stack.

CAN YOU PLEASE GIVE ME SOME LINKS I CAN READ ABOUT HOW TO DO THIS OR ANY LINKS TO PREVIOUS POSTS THAT DISCUSS THIS. ANY HELP WILL BE APPRECIATED.
Nov 21 '07 #1
2 2329
weaknessforcats
9,208 Expert Mod 8TB
The reader thread must periodically check for an event that says to continue.

Use a semaphore.
Nov 21 '07 #2
gpraghuram
1,275 Expert 1GB
The reader thread must periodically check for an event that says to continue.

Use a semaphore.

When u want to wakeup a thread then u should use pthread_cond_signal ad other related calls with condition variables.
Do a search with pthread_cond_t and you will get expected results.

Raghuram
Nov 22 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Peter Åstrand | last post by:
There's a new PEP available: PEP 324: popen5 - New POSIX process module A copy is included below. Comments are appreciated. ---- PEP: 324 Title: popen5 - New POSIX process module
26
by: djw | last post by:
Hi, Folks- I have a question regarding the "proper" use of try: finally:... Consider some code like this: d = Device.open() try: d.someMethodThatCanRaiseError(...) if SomeCondition: raise...
0
by: steffen staehle | last post by:
Hi, I'm writing a server process which spawns child processes via fork This server process should keep track of the number of children stil running, do the necessary cleanup to avoid zombies,...
0
by: Jack Orenstein | last post by:
I'd like to create a program that invokes a function once a second, and terminates when the user types ctrl-c. So I created a signal handler, created a threading.Thread which does the invocation...
1
by: Christopher Stott | last post by:
I'm working on a PIM program, which can function as an alarm clock. It needs to be able to suspend the computer, and wake it up at a particular time. As a test, I'm using a Waitable timer...
0
by: lukasz | last post by:
Hi, could somebody analyze a class and suggest what to do to avoid hanging the class (thread) when the application calling it exits? (Other than using background threads). This class is something...
2
by: dariophoenix | last post by:
Hi, I am trying to encapsulate Linux sockets and POSIX threads in C++ classes (I work in Knoppix, using KDevelop). Since sockets and threads are new to me, I searched for example code and found...
7
by: Adrian Casey | last post by:
I have a multi-threaded python application which uses pexpect to connect to multiple systems concurrently. Each thread within my application is a connection to a remote system. The problem is...
23
by: Boltar | last post by:
Hi I'm writing a threading class using posix threads on unix with each thread being run by an object instance. One thing I'm not sure about is , if I do the following: myclass::~myclass() {...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...

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.