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 GoOp #8426

Closed
wangkuiyi opened this issue Feb 13, 2018 · 2 comments · Fixed by #8593
Closed

Implement GoOp #8426

wangkuiyi opened this issue Feb 13, 2018 · 2 comments · Fixed by #8593

Comments

@wangkuiyi
Copy link
Collaborator

Go has goroutines, and the keyword go starts a goroutine. Fluid needs GoOp as the go keyword in Go.

Goroutines are green threads, which are not scheduling preemptively; instead, they actively give up the CPU time by hanging themselves up in a waiting queue.

Our first version doesn't have to implement green threads and the scheduling system. We could rather just create OS threads using std::thread.

The challenging part of this work is to make the newly created thread runs a block in a ProgramDesc. The WhileOp could be a good reference.

@wangkuiyi wangkuiyi created this issue from a note in Concurrent Programming in Fluid (To Do) Feb 13, 2018
@typhoonzero
Copy link
Contributor

How about we make two thread pools, similar to the Cuda stream that, one for computation intensive threads and one for IO intensive threads. The computation thread pool has number of threads same to CPU cores; The IO thread pool can have dynamically increase number of thread with a maximum count.

@cs2be
Copy link
Contributor

cs2be commented Feb 13, 2018

Here is the proposed API: #8434

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

Successfully merging a pull request may close this issue.

6 participants