5 ms·
> A pet peeve of mine is that libraries often don't document what thread a piece of code will run on. What's wrong with you people? ... Similarly, when is somet
by dahart 11y ago
> A pet peeve of mine is that libraries often don't document what thread a piece of code will run on. What's wrong with you people? ... Similarly, when is something blocking and when is it non-blocking?
Totally agreed about blocking calls, if something's blocking and doesn't say so: boo. Usually boo if something's blocking at all, but I'm sure it depends.
Threading ... is documenting "what thread code will run on" talking mainly whether the callback could happen on a different thread than the caller? Or is there some more specific language or context here?
- kazinator 11y agoPossibly, the concern is whether multiple callbacks from the API share the same thread, or is there a pool, or does it create a new thread? Can you keep that thread as long as you want without impacting the ability of that API to deliver callbacks to other contexts, or must you return that thread ASAP? Can the callback re-enter the API? If there are multiple callbacks pertaining to the same logical transaction do they use the same thread (so that I can, for intsance, lock a mutex in one callback and release it it another?)
- dozzie 11y ago> Totally agreed about blocking calls Sorry, where are you coming from again? Most of the languages out there use blocking call semantics, it's non-blocking (a.k.a. asynchronous) calls that are rare.