vertx-sync
vertx-sync copied to clipboard
vertx-sync direct scheduling question
Hi guys,
I came across a stacktrace where vertx-sync
seems to start a fiber and then the very same thread executes it directly; I think this happens by default unless the context has a different scheduler: https://github.com/vert-x3/vertx-sync/blob/master/src/main/java/io/vertx/ext/sync/Sync.java#L198.
First of all, is my understanding correct? If so: since fibers are not continuations, in general they need a scheduler with some queue, so that fibers can interact correctly (there is a more elaborate discussion about this topic here https://github.com/puniverse/quasar/issues/182#issuecomment-215369232).
An idea could be to simply avoid executing directly the task but I don't know the idea behind the current scheduling approach and what the impacts could be. Could you elaborate on these aspects?
Thanks!
Cross-ref of an issue report in the Quasar group that also shows the "direct" scheduling stack-trace: https://groups.google.com/forum/#!topic/quasar-pulsar-user/P6tObzUTLgU