-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Tom Tromey wrote:

Thanks for the feedback!

> Casey>   - Adds a NativeFD interface to all our Channel implementations that
> Casey> returns the native file descriptor integer. The plan here would be that
> Casey> a Selector implementation could work generically given that you 
> register
> Casey> a Channel that implements NativeFD.
> 
> I think this is the only problematic bit.  AIUI we've been careful
> until now to keep the 'fd == int' identity hidden in the VM layer.
> That makes it all a bit more palatable to VMs on non-posixy platforms;
> IKVM comes to mind.
> 

I'm not convinced that's such an issue, actually. File descriptor
integers are just tokens, which identify some open resource. Mapping an
int to some platform specific resource shouldn't be that hard. Using an
int to identify these resources makes the JNI side much easier to write,
because it requires zero JNI calls (which are a mess) to access that
resource. Doing an int-to-VM-object mapping shouldn't be that hard for
any VM, and shouldn't introduce too much overhead.

This would admittedly be optimizing the whole design to fit a POSIX/JNI
back end. If that's unpalatable, we can investigate using something
else, but personally, I think optimizing the design for JNI and C on
GNU/Linux is worthwhile. As is making our JNI code as simple as
possible, because debugging it can be very difficult.

I'd appreciate hearing opinions on this, of course.

> Casey> This patch also adds a Selector based on kqueue/kevent, the event
> Casey> notification mechanism on Mac OS X, and some BSDs. Kevent is a much
> Casey> better and more scalable API than select() or poll().
> 
> Very cool.
> 
> Casey> I'd like to also write an epoll-based Selector for GNU/Linux, but can't
> Casey> do that right now since my Linux PC went belly-up recently.
> 
> It looks quite easy given the kqueue code.
> 

Yup. Epoll may be even easier, in fact, since it doesn't require holding
on to any structures.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQEVAwUBRNfiz+RILCRAfKHCAQLBWwf6Ay1sq8NL0erdM0HwFIOytAD9jU4XRHic
jx2dxbLaDq5qIEFc94t7xpC0VCS17iDkquVHTv09unnQNTjUgjQqZ9mBYCW0RwTJ
MssTtYtB7ZP/05wCIF+c8Fzx9FggzzzQK4DyyPkjXZW/50F4BaBk5ipsmJqQ6oom
AwEHa37Q0/6vkfKVYoAUVjMYThEXJt+Ec34Je4n7nFU8KIyLYarN5bWjphoTVa/g
eT2Q6c1N+ro5ESjC3KbmJxXMFCbjLOiAEksvpGFlluM4U4NFoDQpOucoWLvXCn5w
kDm0DqzQ9lwwsStQWPhasx+c+5GMj0HsaHQIH/0I1hWpZ2GpwPNhmA==
=xqCJ
-----END PGP SIGNATURE-----

Reply via email to