Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement IPC #77

Open
cstanfill opened this issue Jan 6, 2019 · 0 comments
Open

Implement IPC #77

cstanfill opened this issue Jan 6, 2019 · 0 comments

Comments

@cstanfill
Copy link
Collaborator

Our current design for this is a combination of a synchronous sendrecv() method that transfers execution to another thread temporarily, and an asychronous semaphore system.

cstanfill added a commit that referenced this issue Jan 6, 2019
sendrecv() logically takes a thread id to send to and some registers.
It sends the registers directly to the given thread and immediately
switches stacks to that thread.  Once that is done, the sending thread
becomes a receiving thread and doesn't wake up until it receives a
message back.

The send can only succeed if the thread provided is currently blocked
in another sendrecv() call.  In order to bootstrap this, a thread can
'send' a message to the kernel via thread id 0, which simply puts that
thread into receiving mode without sending anything (it becomes a
daemon).

If all the remaining threads are in receiving mode, they are assumed to
all be daemons and the system shuts down.  This is symmetric to the
bootstrapping behavior before - otherwise it would be impossible to shut
the system down after any thread called sendrecv() in daemon mode.

First PR of #77
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant