-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jarvis Threading Model #67
Comments
Hi Paul! I've conferred with Bjørn about how HTTP chunks are processed and he's confident that the they will be handled in the order sent. |
Is Bjørn confident that they are handled by Conga in the order sent (which I would hope) AND Jarvis (which is what I am concerned about)? |
Ah, I have a better understanding now. It seems your observation is accurate. :hold doesn't implement a FIFO model. For non-chunked requests, there shouldn't be an issue (unless we decide to support pipelining) as the only one HTTPBody event will occur after the HTTPHeader event. But with a chunked request., chunks could get processed out of order. I've got some ideas on how to address this... watch this space... |
Addresses #67 Use tokens (⎕TPUT/⎕TGET) to implement FIFO queue for processing
Each HTTPHeader, HTTPBody, HTTPChunk and HTTPTrailer event is passed to
HandleRequest
in a new thread.HandleRequest
is wrapped in a :hold on the connection name.I've recently discovered or rediscovered that :hold is not a fair mutex. So, if a few events on the same connection queue up on the :hold, I think they will not get access to the critical section in order.
This probably is not a big issue for un-chunked requests, as there are only two events that can happen (Header then Body), so there are never multiple threads waiting on the mutex (This could change if pipelining were implemented).
But I'm concerned about chunked messages. Is it not possible that chunks could queue up waiting for the mutex and then be serviced out of order?
The text was updated successfully, but these errors were encountered: