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

Add Inter Task Communication API #21

Closed
thiell opened this issue Mar 3, 2012 · 2 comments
Closed

Add Inter Task Communication API #21

thiell opened this issue Mar 3, 2012 · 2 comments
Labels
Milestone

Comments

@thiell
Copy link
Collaborator

thiell commented Mar 3, 2012

Currently, each ClusterShell task is independent, running in a separate thread, and inter-task communication is not supported. User could add their own synchronization or communication system but it may be tricky to implement without an access to Engine internals.

This ticket follows the addition of Inter Task/Engine Communication API, probably like a sort of thread mailboxes handled by the Engine at next loop.
This will allow task1 to perform task2.abort(), here is an idea of how it could perform:

{{{

task1

task2.abort()
if task2 != task_self():
task2.engine.mbox_post("abort")
task_mbox_wait("abort_ok") (current task1 waits for "abort_ok" msg)

task2

poll()
-> event read on special mailbox FD
-> "abort" msg received from task1
self.abort()
task1.engine.mbox_post("abort_ok")

}}}

@thiell
Copy link
Collaborator Author

thiell commented Mar 3, 2012

[st-cea] To come: addition of EnginePort in 1.2

@thiell
Copy link
Collaborator Author

thiell commented Mar 3, 2012

[st-cea] Added in r185 (EnginePort).

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

No branches or pull requests

1 participant