[Discussion] The `event:` scheme and threads
Created by: jD91mZM2
Situation
Currently each thread has it's own event queue (they're per context), just like a process. Things like Tokio need to share one event queue between threads.
Proposed solutions
- Do nothing. Tokio can be patched by making mio do everything from one thread. Example can be seen here. This almost works actually, woah. Would be extremely inefficient though. This would be backwards compatible because nothing would actually be done.
- Make them share event queues. I think this would be the easiest way, since threads already share memory somehow. Although this means that it's now impossible for one process to host multiple
event:
instances. Would be a minor change. - Change
fevent
to be a scheme function likefcntl
. This would allow it to sit per-instance rather than per-context. Actually - I'm not sure this would work. Depends on if open files are shared between threads. Would not be backwards compatible. - Change
event:
to take an ID. This would also need a syscall for generating an ID, andfevent
would need to take this ID as an instance. Would not be backwards compatible.
Once a decision is made, is it within my scope of RSoC to adjust the kernel myself, or is it up to whoever is first?