Hi Jason,
This is an issue that I have thought about before, but haven't had a chance to fix properly. As you point out, the underlying issue is that Camkes threading model maps one camkes thread to one seL4 thread (obviously camkes threads are just seL4 threads)
while the rumprun threading model is inherently unicore and the single core is mapped to a seL4 thread. Because of this, any blocking camkes connector involving a rumprun component is not going to work without locking the rumprun system as you point out.
Supporting what you want to requires using non blocking connectors and implementing the blocking in the rumprun component similar to interrupt handling.
If you look at this rumprun kernel module: https://github.com/SEL4PROJ/rumprun/tree/master/platform/sel4/librumpsel4_stdio it has an example of blocking a rumprun
thread implemented by using notification objects and shared memory to do synchronous calls to another seL4 component. (It's not in camkes however, just calling back to the root task). You may be able to use it for inspiration. The rumprun thread blocks on
a rumpkernel synchronisation primitive after notifying the other seL4 process. The response from the other process is passed through via the same mechanism as hardware interrupts where the interrupt thread will wake up the rumprun thread from within the rumpkernel.
The other approach you mention of using multiple seL4 threads requires adding multicore support to rumprun unikernel which is likely going to be harder than implementing a new seL4 rump kernel platform layer that has multicore support designed in from the
start.
We've been looking into adding better mixed-threading-model component support in Camkes as we have requirements to build CakeML components which are single threaded. Some of these new mechanisms could end up being used to better create rumprun Camkes connectors,
but there are no concrete plans at this stage.
Kent.