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

How can May be used for shared-nothing architecture? #107

Open
Eugene-Usachev opened this issue Mar 9, 2024 · 3 comments
Open

How can May be used for shared-nothing architecture? #107

Eugene-Usachev opened this issue Mar 9, 2024 · 3 comments

Comments

@Eugene-Usachev
Copy link

I would like to have an example in the documentation for this task. I looked at the source code and I had some doubts about the possibility of building a shared-nothing architecture. On the one hand, there is CoroutineLocal and the ability to create multiple Schedulers. But on the other hand, almost everywhere there is a requirement for Send and almost everywhere there are, if not locks, then atomics. If I'm wrong and May allows you to build shared-nothing architectures, let me know.

@Xudong-Huang
Copy link
Owner

stackful coroutines are independent to some extend, in theory they can be executed everywhere. The atomics and locks are only tools that designed for state sharing and it totally depends on how custom program coroutines. I don't have too much knowledge about shared-nothing architecture. and don't fully understand the real requirements.

@Eugene-Usachev
Copy link
Author

I would like to have some kind of LocalExecuter that has no requirements for either Send or Sync and that performs tasks strictly sequentially. Conditionally, within the framework of one such executor, I could create 10 tasks that generate other tasks, but all these tasks will be performed within the same thread and sequentially. This allows us to get rid of locks and atomics, since we do not have competition for resources.

If this functionality already exists, I'd like to know about it. If such a thing exists, I am ready to write an example for documentation myself.

@Xudong-Huang
Copy link
Owner

oh, currently there is no mechanism for coroutine thread affinity. but when work_steal feature is disabled, coroutines would execute in the same thread where they got first executed.

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

2 participants