Overview
| Artifact ID: | 10fd0b0bcc2252d7674213a2d4a817f94ad716af |
|---|---|
| Ticket: | b9bfaf5fdb2cb794475fa70121c88859a8fc8496
EAGAIN throw in reflected channel in blocking mode causes eof (data loss) |
| User & Date: | apnadkarni on 2016-07-12 02:24:43 |
Changes
- icomment:
OK, I misunderstood your original post. I thought you had a reflected channel in the main thread that wrapped another reflected channel in the worker thread as opposed to transferring the channel created in the worker thread to the main thread. The behaviour exhibited in your demo code does not seem like a bug to me. If the transferred channel is set to blocking mode, EAGAIN should result in an EOF. In the common case of a single thread, how would you expect the channel code to behave on seeing a EAGAIN? It cannot return to the caller because it is supposed to be a blocking call. It cannot go to the event loop via vwait or similar because that is not supposed to happen in a blocking call where no other code is supposed to execute until the blocking call returns. And I seriously doubt we would want differing behaviour depending on whether the app is using multiple threads or not (whether the channel code to track that is a different matter). I also suspect that changing this documented behaviour, even if possible, would break existing implementations.
- login: "apnadkarni"
- mimetype: "text/plain"