[{"data":1,"prerenderedAt":364},["ShallowReactive",2],{"project-5645787":3},{"id":4,"name":5,"line":6,"line_source":7,"title":8,"url":9,"domain":10,"maker":11,"posted_at":12,"year":13,"points":14,"comments":15,"rank_in_year":16,"shown_in_year":17,"top":18,"tier":19,"category":20,"subcategory":21,"format":22,"keywords":23,"reception":29,"sentiment":30,"stance_mix":31,"scored_comments":36,"aspects":37,"strip":46,"post_text":48,"what":49,"said":88,"maker_in_thread":181,"shape":190,"grid":195,"attempts":326,"same_week":327,"maker_shows":40,"maker_hidden":356,"reader_version":357,"card":358},"5645787","Quasar \u002F Pulsar","Lightweight Threads, Channels and Actors for the JVM","title","Show HN: Lightweight Threads, Channels and Actors for the JVM","http:\u002F\u002Fblog.paralleluniverse.co\u002Fpost\u002F49445260575\u002Fquasar-pulsar","blog.paralleluniverse.co","pron",1367514402,2013,116,54,191,1739,11,"notable","languages","concurrency library for the jvm","library",[24,25,26,27,28],"lightweight threads","actors","jvm concurrency","fibers","erlang","curious",-0.011,{"positive":32,"neutral":33,"mixed":34,"critical":35},4,18,0,6,28,{"idea":38,"performance":41,"execution":42,"docs":44,"design":45},{"positive":39,"critical":40},1,3,{"positive":39,"critical":34},{"positive":34,"critical":43},2,{"positive":34,"critical":34},{"positive":34,"critical":39},[40,34,47,40,34,40,40,34,39,40,34,39,40,34,40,34,34,40,47,40,40,39,39,34,40,34,40,40,40,34,34,39,34,34,40,40,34,39,47,47],5,null,{"problem":50,"audience":60,"pricing":48,"motivation":71,"time_to_build":48,"stack":78,"openness":87,"stage":87,"team_size":87},{"value":51,"source":52,"evidence":53},"Provides lightweight threads and Erlang-style actors on the JVM, avoiding OS thread costs","maker",[54,57],{"id":55,"by":11,"text":56},"5647575","In general, higher levels have more knowledge of the specific problem domain, and can therefore make more assumptions, while the kernel has to cater to all needs. In this…",{"id":58,"by":11,"text":59},"5647507","Regarding selective receive: the messages aren't replayed whenever a new message comes along. The receive operation keeps a pointer into the queue to the last message scanned.…",{"value":61,"source":62,"evidence":63},"JVM developers building concurrent or actor-based systems","inferred",[64,67],{"id":65,"by":11,"text":66},"5646433","Quasar is Java (Pulsar is a thin Clojure API to Quasar). There's no documentation yet (there will be soon), but the project page directs you to some examples. All the code…",{"id":68,"by":69,"text":70},"5646245","buster","Am i the only one who had to smile at the sentence \"At Parallel Universe we develop complex data structures and distributed data grids, which require a lot of low-level…",{"value":72,"source":62,"evidence":73},"Bring Erlang's concurrency model to the JVM with real lightweight threads",[74,75],{"id":65,"by":11,"text":66},{"id":76,"by":11,"text":77},"5646917","Akka calls them lightweight threads, but they really aren't as they can't be blocked. In short - they're not implemented as continuations. Basing the implementation on real…",[79,83],{"value":80,"source":52,"evidence":81},"Java",[82],{"id":65,"by":11,"text":66},{"value":84,"source":52,"evidence":85},"Clojure (Pulsar API)",[86],{"id":65,"by":11,"text":66},"unknown",{"praise":89,"objections":106,"requests":127,"questions":139,"alternatives":151},[90,99],{"value":91,"source":92,"evidence":93},"Lightweight threads are a clear improvement over OS threads for memory and switching","commenter",[94,98],{"id":95,"by":96,"text":97},"5648077","ww520","Good question. In general the non-preemptive green-thread\u002Ffiber\u002Flightweight-thread is a pretty well understood notion. Some OS support it, e.g. Windows supports manually…",{"id":55,"by":11,"text":56},{"value":100,"source":92,"evidence":101},"Erlang-style selective receive is a useful feature",[102],{"id":103,"by":104,"text":105},"5647310","shinolajla1234","Selective Receive sounds great. Any idea how to handle messages that continue to pile up behind your actor when they're never handled? Do they get culled somehow after a period…",[107,113,120],{"value":108,"source":52,"evidence":109},"Cannot isolate GC pauses per actor like Erlang on HotSpot",[110],{"id":111,"by":11,"text":112},"5646097","Jetlang doesn't offer lightweight-threads. It uses an event-driven processing of messages (like Akka), so fibers can't block and you can't do selective receives. The JVM's GC…",{"value":114,"source":92,"evidence":115},"Cooperative threads are not true preemptive scheduling",[116],{"id":117,"by":118,"text":119},"5651192","saurik","This starts turning into a semantics problem. GHC is a compiler that modifies the code it has compiled to add \"synchronization points\" that are used under a cooperative threading…",{"value":121,"source":92,"evidence":122},"Unbounded mailboxes and lack of supervision are risks",[123,124],{"id":103,"by":104,"text":105},{"id":125,"by":104,"text":126},"5647675","If you're not replaying unhandled messages, you're not doing selective receive. To quote LYSEFGG, \"Ignoring some messages to handle them later in the manner described above is…",[128,132],{"value":129,"source":92,"evidence":130},"Documentation and Java code examples",[131],{"id":68,"by":69,"text":70},{"value":133,"source":92,"evidence":134},"Distribution story and comparison to Akka",[135],{"id":136,"by":137,"text":138},"5647441","alexatkeplar","Looks cool, but what's the distribution story? I'm not sure I understand the comparisons to Akka without one.",[140,147],{"value":141,"source":92,"evidence":142},"Why are lightweight threads more efficient than OS threads",[143],{"id":144,"by":145,"text":146},"5647447","zmmmmm","Ignorant newbie here, but would love to hear views on this: I always treat with great skepticism claims that you can implement an inherent operating system function (eg: threads)…",{"value":148,"source":92,"evidence":149},"How selective receive handles unhandled messages",[150],{"id":103,"by":104,"text":105},[152,160,167,174],{"value":153,"source":92,"evidence":154},"Akka",[155,159],{"id":156,"by":157,"text":158},"5646294","gtani","Could you enumerate your specific perceived shortcomings of akka that you allude to in blog post?",{"id":125,"by":104,"text":126},{"value":161,"source":92,"evidence":162},"Kilim",[163],{"id":164,"by":165,"text":166},"5646525","rektide","``` There have been several attempts of porting actors to the JVM. Quasar and Pulsar’s main contribution — from which many of their advantages stem — is true lightweight…",{"value":168,"source":92,"evidence":169},"Jetlang",[170],{"id":171,"by":172,"text":173},"5646030","oinksoft","How does this compare with http:\u002F\u002Fcode.google.com\u002Fp\u002Fjetlang\u002F ? How does this work with garbage collection? Is the GC per-process (\"fiber\"), like in Erlang?",{"value":175,"source":92,"evidence":176},"Erlang",[177],{"id":178,"by":179,"text":180},"5648069","stonemetal","http:\u002F\u002Fstackoverflow.com\u002Fquestions\u002F2708033\u002Ftechnically-why-is-processes-in-erlang-more-efficient-than-os-threads No concrete benchmarks but everything I can find makes the same…",{"comments":182,"answered":183,"key":184},16,12,[185,186,187],{"id":55,"text":56},{"id":58,"text":59},{"id":188,"text":189},"5647852","The skipped messages will be replayed in the \"outer\" receive. Obviously, selective receive has its drawbacks, but it's part of what makes Erlang simple, and it can significantly…",{"commenters":191,"max_depth":192,"maker_replies":182,"first_comment_mins":193,"lifespan_hours":194},24,8,7,48,[196,198,200,202,204,206,210,212,215,217,219,221,223,225,228,230,232,234,236,240,241,243,246,249,251,252,255,257,258,261,264,265,267,269,271,275,278,281,283,287,289,291,293,298,301,304,307,310,311,313,315,317,320,323],[144,34,40,197,145,34],"project\u002Fneutral\u002Fidea",[55,34,34,199,11,39],"project\u002Fpositive\u002Fidea",[178,34,40,201,179,34],"project\u002Fneutral\u002Fperformance",[95,34,47,203,96,34],"project\u002Fpositive\u002Fperformance",[205,34,40,197,118,34],"5648364",[207,34,34,208,209,34],"5650003","commenter\u002Fneutral\u002Fperformance","chongli",[117,34,34,211,118,34],"commenter\u002Fneutral\u002Fidea",[213,34,40,197,214,34],"5648398","reeses",[103,39,40,216,104,34],"project\u002Fneutral\u002Fexecution",[58,39,34,218,11,39],"maker\u002Fpositive\u002Fexecution",[125,39,39,220,104,34],"project\u002Fcritical\u002Fexecution",[188,39,34,222,11,39],"maker\u002Fneutral\u002Fexecution",[224,39,40,216,104,34],"5647958",[226,39,34,227,11,39],"5648110","maker\u002Fneutral\u002Fidea",[229,39,39,220,104,34],"5648927",[231,39,34,222,11,39],"5649306",[68,43,40,233,69,34],"project\u002Fneutral\u002Fdocs",[65,43,34,235,11,39],"maker\u002Fneutral\u002Fdocs",[237,43,34,238,239,34],"5648943","commenter\u002Fneutral\u002Fnone","cgh",[171,40,40,197,172,34],[111,40,34,242,11,39],"maker\u002Fneutral\u002Fperformance",[244,40,34,245,172,34],"5646111","commenter\u002Fpositive\u002Fnone",[247,40,40,216,248,34],"5649763","JulianMorrison",[250,40,40,197,248,34],"5649750",[164,32,47,199,165,34],[253,32,34,238,254,34],"5646578","swannodette",[256,32,40,197,165,34],"5646661",[156,47,40,227,157,34],[259,47,39,260,165,34],"5646539","project\u002Fcritical\u002Fidea",[262,47,39,260,263,34],"5646847","tmarthal",[76,47,34,199,11,39],[266,47,34,238,137,34],"5647456",[268,47,40,201,157,34],"5647906",[270,47,34,203,11,39],"5648433",[272,35,34,273,274,34],"5646492","other\u002Fneutral\u002Fnone","jqgatsby",[276,193,40,233,277,34],"5645848","jared314",[279,192,40,216,280,34],"5652715","willemsst",[282,192,34,222,11,39],"5655525",[284,285,40,201,286,34],"5648977",9,"SatishPuranam",[288,285,34,242,11,39],"5649779",[290,285,34,208,286,34],"5653034",[292,285,34,242,11,39],"5654550",[294,295,39,296,297,34],"5645936",10,"project\u002Fcritical\u002Fdesign","Scramblejams",[299,295,34,300,11,39],"5645955","maker\u002Fneutral\u002Fdesign",[302,295,34,303,297,34],"5646086","commenter\u002Fmixed\u002Fdesign",[305,295,34,306,11,39],"5646106","maker\u002Fneutral\u002Fnone",[308,295,40,309,165,34],"5646602","project\u002Fneutral\u002Fdesign",[136,18,40,197,137,34],[312,18,34,227,11,39],"5647600",[314,18,39,260,137,34],"5647662",[316,18,34,227,11,39],"5649668",[318,18,47,319,137,34],"5649768","maker\u002Fpositive\u002Fnone",[321,18,34,273,322,34],"5647705","fretless",[324,183,47,319,325,34],"5645989","vj44",[],[328,333,337,342,347,352],{"id":329,"name":330,"points":331,"category":332},"5672515","Flattest Route",237,"dev_tools",{"id":334,"name":335,"points":336,"category":20},"5643801","Weekend project",196,{"id":338,"name":339,"points":340,"category":341},"5675229","Uncover",178,"web_saas",{"id":343,"name":344,"points":345,"category":346},"5672354","Nemaload",147,"learning_science",{"id":348,"name":349,"points":350,"category":351},"5663041","Zapier API Status Board",143,"infrastructure",{"id":353,"name":354,"points":355,"category":341},"5661974","Freelancer Sticker",75,false,"v2",{"id":359,"name":5,"line":6,"ai":356,"cat":20,"year":13,"points":14,"comments":15,"rec":29,"s":360,"top":18,"kw":361,"maker":11,"domain":10,"tier":19,"attempts":34,"strip":362,"url":9,"mix":363,"praise":91,"objection":108,"sub":21},5645787,-0.01,[24,25,26,27,28],"3053033013013030035331103033300100330155",[32,33,34,35],1793990893871]