i've taken a look at quasar a couple other times and always been overwhelmed by the lack of documentation and the amount of black magic happening under the hood. decided to take advantage of the long weekend to finally grok it
for stateless operation such as a web server, you can just use the fork/join scheduler and things work out of the box. but the real power of fibers is the ability to manually schedule them - obviating the need for locks in many cases. there's not much documentation or many examples of doing this, and based on some of the comments from pron (eg, "we won't be recreating a continuation") on this mailing list i nearly concluded that it couldn't be done
I guess you're referring to lack of documentation about the specific use case you describe
suggestions (or even better contributions) are always welcome
and/or ask for advice here
To view this discussion on the web visit https://groups.google.com/d/msgid/quasar-pulsar-user/af8f3528-fe74-477c-a8e6-1fea4a684be3%40googlegroups.com.--
You received this message because you are subscribed to the Google Groups "quasar-pulsar-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to quasar-pulsar-u...@googlegroups.com.
I guess you're referring to lack of documentation about the specific use case you describe"co-operative" isn't a specific use case, it's fundamental to a fiber, which is what quasar purports to be
- your links mention FiberExecutorScheduler exactly once, and only to say "even on a particular thread" and link the javadocs
- those javadocs provide no usage guidance and comprise in total 3 short sentences that do nothing but rehash the method and parameter names
- the javadocs for Fiber have no description for interrupted, park, parkAndUnpark, sleep, yield, and yieldAndUnpark - all static methods in the public API
- tests aren't a meaningful way to document a public API because they are injected into a package, exposing the internal API
is that enough documentation of your lack of documentation to get you to drop the condescending attitude, or should i go on ?
- does my example work because i'm using the park/unpark API correctly ?
- if i want to abandon an unfinished computation, is it sufficient to null out the fiber or do i need to do something else to free up some hidden resource ?
i've taken a look at quasar a couple other times and always been overwhelmed by the lack of documentation and the amount of black magic happening under the hood. decided to take advantage of the long weekend to finally grok itfor stateless operation such as a web server, you can just use the fork/join scheduler and things work out of the box. but the real power of fibers is the ability to manually schedule them - obviating the need for locks in many cases. there's not much documentation or many examples of doing this, and based on some of the comments from pron (eg, "we won't be recreating a continuation") on this mailing list i nearly concluded that it couldn't be doneafter 16 hours yesterday, things finally started to work. here's a "hello world" for fibers using a manual scheduler, park, unpark and start. this all runs in a single thread (2 scheduler threads are created but i don't believe they ever do any work) without recursion. my "scheduler" is trivial, but could be extended to a state machine (one of the most powerful metaphors for using fibers) in a straight-forward way
FYI, Quasar fibers are preemptive, not cooperative
I haven't found yet a definition of "fiber" more rigorous than "lightweight threads w/cooperative multitasking"
--
You received this message because you are subscribed to the Google Groups "quasar-pulsar-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to quasar-pulsar-u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/quasar-pulsar-user/923c80c5-747d-4a22-89fe-2b8efa037633%40googlegroups.com.
pron wrote:FYI, Quasar fibers are preemptive, not cooperativefabio wrote:I haven't found yet a definition of "fiber" more rigorous than "lightweight threads w/cooperative multitasking"this is probably a big part of my confusion - quasar looks like a fiber library, but (the non-strongly-discouraged portion of) quasar fibers aren't fibers, and quasar is more of an alternative to JVM threads (with much lower costs for some use cases). the quasar docs overview doesn't actually mention fibers, but the rest of the document uses the term freely and most of the articles i read highlighted the fiber aspect (i'll make a separate post about something i found looking back over them while writing this reply)
it's a good thing i didn't know this when i started ... i might have given up. as is, i ended up porting my application to quasar pretty quickly once i had the hello-world demo working (i was already managing concurrency by effectively single-threading things). i hope you'll keep the (discouraged) portions that allow for cooperative scheduling of fibers in future versions of quasar. and thanks for taking a look at my usage of the park/unpark api
in addition to this manually scheduled portion, i have a thin stateless front end, and for that i used the default FJP scheduler, and i bridged the two using a quasar channel