
Hello, Can any one tell me how can I unblock a thread that is block in a socket? I'm using the select/pselect function to detect activity in a group of sockets, and when I'm try to stop the thread she can be lock in the select function. Thanks in Advance, Rui Gil

On 10/27/07, Rui Gil <ruigil@gmail.com> wrote:
Hello,
Can any one tell me how can I unblock a thread that is block in a socket? I'm using the select/pselect function to detect activity in a group of sockets, and when I'm try to stop the thread she can be lock in the select function.
Add an unnamed pipe end to the select fd set and write to the other end when you want the select call to terminate. But I do not see how this is Boost related. gpd

The reason why I send this question it's because I'm using boost threads and they don't have any mechanism to stop a thread. So I think that is reasonable to ask boost community how they use to resolve this issue. Thanks again, Rui Gil On 10/27/07, Giovanni Piero Deretta <gpderetta@gmail.com> wrote:
On 10/27/07, Rui Gil <ruigil@gmail.com> wrote:
Hello,
Can any one tell me how can I unblock a thread that is block in a socket? I'm using the select/pselect function to detect activity in a group of sockets, and when I'm try to stop the thread she can be lock in the select function.
Add an unnamed pipe end to the select fd set and write to the other end when you want the select call to terminate.
But I do not see how this is Boost related.
gpd _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

On 10/27/07, Rui Gil <ruigil@gmail.com> wrote:
The reason why I send this question it's because I'm using boost threads and they don't have any mechanism to stop a thread. So I think that is reasonable to ask boost community how they use to resolve this issue.
A good boost solution for this problem is ASIO. That nicely wrap all socket related funcitonality (async IO included). gpd

Rui, The Boost list's convention is to preface the Subject with the name of the library involved. That ensures that those knowledgeable about that library see your posting and allows others to skip the thread. Thanks, --Beman
participants (3)
-
Beman Dawes
-
Giovanni Piero Deretta
-
Rui Gil