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

Suggestion: Producer/Consumer #23

Open
miguelmartin75 opened this issue Jan 6, 2017 · 1 comment
Open

Suggestion: Producer/Consumer #23

miguelmartin75 opened this issue Jan 6, 2017 · 1 comment

Comments

@miguelmartin75
Copy link

miguelmartin75 commented Jan 6, 2017

Just watched your talk and looked at your particle example. Good job on the library. I didn't really think of system logic being an (implicit) DAG (though one could interpret it as it having a cycle due to the game loop) which is neat.

On to the point of this issue. I have a small suggestion, though I'm not sure how feasible it is or if it is really all that necessary, but I figured I would suggest it anyway.

From my understanding a system can output data that other system(s) can consume (not sure if a set of systems can consume data from one producing system). However, from my observations, this approach requires the system producing the data to produce all of the data before any other system(s) that depend on this data to do any work.

To my knowledge, this problem is exactly the generalised producer/consumer problem. Note that multiple producers could obviously be created from inner parallelism (perhaps other ways too) and multiple consumers from multiple subscribers to the data.

To my belief, having this implemented can further increase the potential to utilise all cores of a system, as if the producer(s) and consumer(s) are only dependent on the shared data they can be ran concurrently (by only providing synchronisation over the shared data to implement the problem).

@vittorioromeo
Copy link
Owner

Thanks for the feedback. I completely agree that it would be a nice feature to have, as having to wait for all the system data to be produced is not always optimal.

I think that it would be a huge/difficult change though, as I unfortunately didn't design the library with "streaming between systems" in mind. One possible inspiration for this feature would be RaftLib.

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

2 participants