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

Enhancement - CSPlike channels #199

Open
Bazmundi opened this issue Oct 5, 2018 · 6 comments
Open

Enhancement - CSPlike channels #199

Bazmundi opened this issue Oct 5, 2018 · 6 comments

Comments

@Bazmundi
Copy link

Bazmundi commented Oct 5, 2018

Since Lua-RTOS has tasks it would make sense to look at CSP like channels.

Starting postion might be LuaCSP perhaps. Or perhaps go like lua-channels.

@jolivepetrus
Copy link
Contributor

jolivepetrus commented Oct 7, 2018

@Bazmundi,

Lua RTOS is a multi-thread Lua environment, which means that Lua scripts can run on multiple threads sharing the global state, so a global variable can be shared by multiple threads, and special Lua libraries are provided to protect concurrent access and synchronise threads:

This is slightly different from other Lua concurrent approaches based on processes, in which each process runs a single-threaded Lua instance, each one with its own Lua state. In this approach, a communication mechanism between Lua instances is required to interchange data, because processes are isolated.

As far I can see, I'm not sure about the benefits of introducing a channel communication mechanism in Lua RTOS to share data between threads, because introduces an unnecessary overhead.

@Bazmundi
Copy link
Author

Bazmundi commented Oct 8, 2018 via email

@Bazmundi
Copy link
Author

Bazmundi commented Oct 8, 2018 via email

@Bazmundi
Copy link
Author

Bazmundi commented Jul 5, 2019

If it helps, even Kotlin has gone for channels.

@rosarioculmone
Copy link

Events can be used to synchronize two tasks. For example between producer and consumer for the management of a buffer but I cannot use them. Have any of you tried them?

@Bazmundi
Copy link
Author

Bazmundi commented Nov 5, 2020 via email

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

No branches or pull requests

3 participants