synchonized blocks are not used for coroutines but the code inside the coroutine uses mutexes... so synchonized,wait/notify are present.
For this reason i i want instrument wait/notify ... for replacing normal mutex parking the thread with a mutex suspending the coroutine 2018-01-20 23:24 GMT+01:00 Cristian Lorenzetto < [email protected]>: > "unless your code > requires it". Yes my code contains synchonized blocks. I used also > external libraries using other synchonized blocks. So i can replace > synchonized blocks manually. > > The coroutine runs code using mutex and shared resources. > > 2018-01-20 23:17 GMT+01:00 Torsten Curdt <[email protected]>: > >> > this is a problem for me. >> > >> >> I don't see the problem yet >> >> >> >> > My idea is to use many coroutines instead to use many threads because >> it is >> > more scalable. >> >> >> *nod* >> >> >> Consider i realize a scheduler in which i can push many coroutines. >> > Pratically it is a coroutines pool inside the same thread. >> > >> >> Yes, that is possible. The continuations are not bound to threads. >> >> >> >> > When a corotuines is blocked by a wait() instruction it is not >> necessary to >> > block the thread but it is sufficient to suspend it. >> > When a corotuine is suspended , it is taken another coroutine ready to >> be >> > resumed. In this way the thread is never blocked ... and the global >> > performance will be very hight. >> > >> > For this reason is important to instrument synchronized blocks. >> > >> >> Sorry, but I don't see your point yet. >> >> It's been a while since I wrote that library but... >> Frankly speaking I don't see the need for synchronization. >> The state is handled per thread and it then creates a new continuation. >> There is no mutation an no need for synchronization - unless your code >> requires it. >> > >
