
2014-07-02 10:50 GMT+02:00 Benedek Thaler
*Oliver*: I considered using coroutines, however I don't clearly see how this would solve this problem exactly. IIUC, Coroutines provide a way for a single thread to execute multiple methods. I'd need multiples threads executing multiple methods in a similar fashion. I'll continue thinking about this.
1.) 1 thread -> 1 method - coroutines not required 2.) 1 thread -> n methods (coroutines or fibers) - each coroutine/fiber could execute one method - multple coroutines/fibers executed in one thread == thread executes multiple methods - you need to know when a method has to be executed/resumed -> synchro. classes + scheduler required required -> fibers (boost.fiber) - you could chain multiple threads (thread-pool?) with channels/queues together => fixed sized thread-pool running arbitrary amount of methods
I couldn't found it in the docs. Does Coroutine have any drawbacks?
it depends on what you want to achieve