This is the mail archive of the
mailing list for the pthreas-win32 project.
RE: cancellation API
- From: Mark Pizzolato - pthreads - win32 <MarkPizzolato-pthreads-win32 at subscriptions dot pizzolato dot net>
- To: Roger Pack <rogerdpack2 at gmail dot com>, pthreads-win32 <pthreads-win32 at sourceware dot org>
- Date: Fri, 20 Dec 2013 09:56:59 -0800
- Subject: RE: cancellation API
- Authentication-results: sourceware.org; auth=none
- References: <CAL1QdWeVXV2CguLFXGhxtF8AqSoAzHx7yxL9BwJn79TVhFZUww at mail dot gmail dot com>
On Friday, December 20, 2013 at 9:50 AM, Roger Park wrote:
> After a bit of googling, i was still a bit confused. Does the win32-pthreads api
> support cancellation for things like recv() from sockets or not? (I assume the
> standard pthreads does?) Thank you, just wondering.
There is no special awareness of thread context from within the recv() (or any networking APIs). So, canceling would be potentially problematic. However, from my experience, if another thread closes the socket which the thread you're concerned with is reading on, the read will complete with an error. The reading thread can then clean up and exit on its own.