thread waiting for events

K

Karim Bernardet

Hi

In an client/server application made of singletons, the server can send
unix commands which must be executed on the clients, then the clients
return the outputs to the server. On the client, I have a threaded
singleton actionsManager() which manages thoses actions (unix command).
Those actions are also threaded with a timeout.
I don't know a good way for the actionsManager() to wait for theses
commands. I could use a while(1) loop for that but it is not really
good. Is there a better way to that ?

Cheers

Karim
 
G

Gianni Mariani

Karim said:
Hi

In an client/server application made of singletons, the server can send
unix commands which must be executed on the clients, then the clients
return the outputs to the server. On the client, I have a threaded
singleton actionsManager() which manages thoses actions (unix command).
Those actions are also threaded with a timeout.
I don't know a good way for the actionsManager() to wait for theses
commands. I could use a while(1) loop for that but it is not really
good. Is there a better way to that ?

This is not a C++ question. This is a unix/posix question. Things like
select, poll, kpoll, epoll (the last 2 being BSD/Solaris and Linux
specific) come to mind. Then again, signals, pipes, msg queues and or
semaphores might be better for you. You'll need to be very specific
when you post your question to the right newsgroup.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,150
Latest member
MakersCBDReviews
Top