Ticket #35 (new feature) | |||||||||||||||||||||
Opened 4 years ago Socket interruptible poll()
Description
Currently if you poll a socket you cannot safely write to this socket in a multi-threaded environment. Even worse, if you want to allow this you have to poll with a timeout and check if data has to be written. This has two drawbacks:
The idea to solve this is taken from the Avahi project: You open an internal pipe in the socket. The pipe has a file descriptor as well. This way you can poll for both descriptors, the socket and the pipe. If you now want to write you can interrupt the poll by writing to the pipe. The poll will return indicating not that read() is possible but that a write bas been requested. This solves both of the problems above. You do something only if tasks are actually waiting and you can interrupt the poll immediately.
Code is in front of my eyes, just has to be written down and tested...
Note: See
TracTickets for help on using
tickets.
| This list contains all users that will be notified about changes made to this ticket. These roles will be notified: Reporter, Subscriber, Participant
| ||||||||||||||||||||

