Sweet! I will look and land tommorow unless I run into questions...Rails work is dominating this evening...
-Tom On Sat, 06 May 2006, Evan Buswell defenestrated me: > I've got a working select now, and WEBrick::GenericServlet runs! (There > is an error about Fnctl missing, but it should be relatively harmless). I > haven't tested WEBrick's http stuff yet, but I suspect it more or less > works. > > Possible concerns about this implementation: > > Java Selectors *require* that Channels (files, sockets...) be in > non-blocking mode in order to correctly execute a select. In order not to > break any of the non-select code, I manually set all channels to > nonblocking before the select, and manually set it back to blocking after > the select. What this means is that select is not thread safe, i.e. two > threads can't select on the same socket at the same time without something > possibly going wrong. As select is usually used in order *not* to have a > big threading mess, this shouldn't be a practical problem, but it is a > theoretical limitation. > > When, in the future, we support calls to set things nonblocking or > blocking at will, it will be fairly easy to set up wrappers to return the > socket to its default state instead of just arbitrarily making the socket > block again. There is some Java support to do this Thread-safely. > > The real worry is what happens when one thread recv()s blocking while > another thread select()s? the recv *must* turn nonblocking or the select > won't work, but that's not proper semantics (AFAIK). > > Anyway, this should be good enough for 99% of code out there. > > Patch attached, with changes: > > * all the socket stuff in the socket patch from about a week ago > * the nio stuff from a few days ago > * select() > * some extra constants defined in Socket::Constants to make WEBrick happy. > > Evan -- + http://www.tc.umn.edu/~enebo +---- mailto:[EMAIL PROTECTED] ----+ | Thomas E Enebo, Protagonist | "Luck favors the prepared | | | mind." -Louis Pasteur | ------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Jruby-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jruby-devel
