Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Daniel Pitts Newsgroups: comp.lang.java.programmer Subject: Re: : Light Weight Channels Lib anybody Date: Fri, 8 Jul 2016 10:25:45 -0700 Organization: A noiseless patient Spider Lines: 37 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Fri, 8 Jul 2016 17:25:47 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="28fd04db1cb664d5f0327ee1b3007172"; logging-data="4667"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/sDlbcXekyVz2wS6s8Uq5nbJ2pmGa7+KE=" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 In-Reply-To: Cancel-Lock: sha1:QYyRj7QQQ1o1OLbtmtODdspUdGU= Xref: csiph.com comp.lang.java.programmer:34797 On 7/8/16 10:17 AM, Jan Burse wrote: > Interesting. Small question before I go deeper in your code, is > your code supposed to be a variant of: > https://docs.oracle.com/javase/7/docs/api/java/nio/channels/Selector.html > > Because I consider this not as light weight, rather heavy > weight, since it uses the OS channels. Also delegates to > the OS poll. > > I would like to use some very simple home grown pipes(*) > as channels, and don't need to support something else > as channels. Yes, my code uses the Selector class. I think I misunderstood your original question, which I think maybe is about same-process communication. There are *many* ways to do that with Java. PipeInputStream and PipeOutputStream are one way. The java.util.concurrent package has a lot of other ways to efficiently pass data between threads as well. > > Bye > > (*) > http://www.jekejeke.ch/idatab/doclet/blog/en/docs/05_run/01_kernel/misc/Queue.html > > > Daniel Pitts schrieb: >> I just so happen to have created such a thing myself a while back: >> >> https://github.com/StochasticTinkr/net.virtualinfinity.nio >> >> Note that Golang has different semantics than Java, so you can't do a >> one-to-one translation. >