Speaking of which, NIO is certainly a subset of Java that would benefit from
a nice Clojure wrapper.  Not that I'm volunteering or anything.

On Tue, Oct 20, 2009 at 3:06 AM, Alex Osborne <a...@meshy.org> wrote:

>
> John Harrop wrote:
> > On Tue, Oct 20, 2009 at 12:07 AM, Alex Osborne <a...@meshy.org
> > <mailto:a...@meshy.org>> wrote:
> >
> >     Gorsal wrote:
> >      > However, this raises the CPU to about 50 percent. This is due to
> the
> >      > infinite recursion, I'm assuming?
> >
> >     Yes, it's because you're tight looping, checking to see if data is
> >     available as fast as possible.  A quick and dirty hack would be to
> put
> >     in a sleep to slow it down a bit.
> >
> >
> > A blocking operation and Java's Thread.interrupt() method would be
> cleaner.
>
> Yes, that's why I suggested NIO.  Apparently you can't interrupt an (old
> IO) read though:
>
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4514257
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to