On 21/04/20 8:29 am, Eric Snow wrote:
* Would a low-level channel implementation based on callbacks or locks be better (simpler, faster, etc.) than one based on buffering?
Depends on what you mean by "better". Callbacks are more versatile; a buffered channel just does buffering, but with callbacks you can do other things, e.g. hooking into an event loop.
* Would readiness callbacks in the high-level API be more or less user-friendly than alternatives: optional blocking, a lock, etc.?
I would consider callbacks to be part of a low-level layer that you wouldn't use directly most of the time. Some user-friendly high-level things such as buffered channels would be provided. Efficiency is a secondary consideration. If it turns out to be a problem, that can be addressed later. -- Greg