TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Implementing, Abstracting and Benchmarking Lightweight Threads on the JVM

39 pointsby dafnapover 11 years ago

4 comments

justinsbover 11 years ago
I noticed that you send the &quot;native threading&quot; case through your library as well. Have you compared to just using &quot;naive&quot; Java - Threads and a BlockingQueue?<p>Also: if the Google patches for the user-mode threading are adopted, will Quasar have any advantages over a JVM that uses the same syscalls? Can you explain where this would come from?<p>I think what you&#x27;ve done is genuinely cool, I&#x27;m just trying to better understand what the 10x advantage actually comes from.
评论 #7192593 未加载
donjigweedover 11 years ago
&quot;because it uses macros, the suspendable constructs are limited to the scope of a single code block, i.e. a function running in a suspendable block cannot call another blocking function; all blocking must be performed at the topmost function. It’s because of the second limitation that these constructs aren’t true lightweight threads, as threads must be able to block at a any call-stack depth&quot;<p>Can you elaborate on this a bit? Let&#x27;s say I have a function called &#x27;fetch-url&#x27; which takes a core.async channel as an argument and makes a non-blocking http request (say, using http-kit), and in the callback handler i put the result onto the channel. If I&#x27;m in some other function, in which whose body I open a core.async go block and call fetch-url from within that go block, everything is still asynchronous is it not?
评论 #7192578 未加载
RyanZAGover 11 years ago
Any chance of someone putting together a benchmark for <a href="http://www.techempower.com/benchmarks/" rel="nofollow">http:&#x2F;&#x2F;www.techempower.com&#x2F;benchmarks&#x2F;</a> for quasar? It would be nice to see how it compares to other techniques.
Fasebookover 11 years ago
Wouldn&#x27;t this kind of development target be better served by optimizing small C&#x2F;++ programs instead of trying to optimize to some abstract virtual machine implemented on top of the hardware? I mean if speed really is your goal, why not do it correctly instead of hitting yourself in the face with an extra tree before starting?
评论 #7192856 未加载
评论 #7192980 未加载