trafficserver icon indicating copy to clipboard operation
trafficserver copied to clipboard

Add new API TSContScheduleOnEntirePool and TSContScheduleEveryOnEntirePool

Open duke8253 opened this issue 1 year ago • 5 comments

Adds two new APIs that allow scheduling continuations on all threads of a certain thread type (e.g. ET_NET, ET_TASK):

std::vector<TSAction> TSContScheduleOnEntirePool(TSCont contp, TSHRTime timeout, TSThreadPool tp)
std::vector<TSAction> TSContScheduleEveryOnEntirePool(TSCont contp, TSHRTime every, TSThreadPool tp)

The behavior is similar to EventProcessor::schedule_spawn().

duke8253 avatar Nov 07 '23 17:11 duke8253

[approve ci]

bneradt avatar Nov 07 '23 22:11 bneradt

[approve ci]

duke8253 avatar Nov 07 '23 23:11 duke8253

I don't like the double vector implementation. I think it would be reasonable to have the core methods return TSAction instead of TSEvent, because

  • The latter can be extracted from the former.

  • It avoids the double allocation.

  • It hides the pointer hacking in the Event system instead of the API implementation.

That does sound better, I'll change that. Did it this way since the other ones had that part in the API.

duke8253 avatar Nov 09 '23 20:11 duke8253

@zwoop I think this is ready for another review

duke8253 avatar Dec 01 '23 16:12 duke8253

[approve ci format]

bneradt avatar Dec 01 '23 20:12 bneradt

[approve ci autest]

duke8253 avatar Mar 01 '24 18:03 duke8253