[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[Libevent-users] Socket shutdown part 2.
Hi Folks,
Added a comment to the shutdown feature request (ID: 3108251) which
I figured I should cover in more detail. The basics are covered in the
feature details (though probably correcting mistakes here as I think about
it further) but I'm not entirely certain I made complete sense in the
description (and most testing is IOCP based). So, I want to repeat things
here and hopefully clarify/correct any of the issues involved within the
easier e-mail list medium.
So, as part of the clean shutdown system desires, I'd like to see
the following changes:
1. Remove the EOF "event" as an event. Separation of the "stream" of
data and the "end of data" causes a threading problem in terms that you
don't know if a callback is already queued or in progress. Without the
stream including the EOF I've effectively made my system single threaded by
locking a socket mutex constantly in order to fix the shutdown problem.
But, I've lost all multithreaded benefits by doing so.
2. Maintain EOF "event" but only call it after all outstanding
read/writes are absolutely complete. I.e. EOF detected and zero read/write
evbuffers exist. This has been my current issue trying to shut things down
completely clean at all times.
Can't think of other problems, but sure I'll come up with them. :)
KB
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users in the body.