Slight adjust to the thread affinity logic#5089
Conversation
…he same as the target thread
shinrich
left a comment
There was a problem hiding this comment.
Looks good. By biasing continuations to stay on the same thread on when operating within a pool, continuations associated with a transaction will be more likely to stay on the thread associated with the netvcs.
|
This is fine, but I will reiterate what we discussed in person - I want to see good documentation on how this works, both for future maintenance and for people writing code that uses this. |
|
Yes, docs are coming. |
|
The This PR makes the sub-Cont/SM to run in the IMO, this is not a valuable change. -1 |
|
That's a feature, not a bug. Because of the nature of the operations, the Finally, I would dispute the claim that |
|
So can it save the original thread in some where . And HostDB callback to the original thread when dns searching successfully the same as what CacheVC does. This pr involve a new feature but get rid of another feature. |
|
below is Maybe you confuse NetHandler is a batch processor for UnixNetVCs, it calls back If one HttpSM schedule a Cont to current EThread, the Cont is called back only after all the NetVCs processed by related HttpSM. To schedule an Event to an EThread which is picks up by round robin policy, the Cont maybe called back earlier than current EThread. I can't describe the performance gap between them. My advice is to keep the original code and use |
|
@scw00 That is what was done in various locations in a cut and paste fashion. It is, in my view, much more robust to have a common mechanism all of these places can use. @oknet You may be correct, let me look again and then talk to Fei. I would agree that |
|
Now I'm more confused. This PR only changes In terms of an |
Set thread affinity to current thread if the current thread type is the same as the target thread.