Re: Why nonblocking I/O in Java is hard

2000-06-12 Thread Dimitris Vyzovitis
Matt Welsh wrote: Well - anything you do with native code in Java is inherently "dangerous". In a sense yes, but trying to do direct system lib access, while on the same time the green threads lib does its magic makes it suicidial. Although it might even work, I wouldn't put much trust on it - ex

Re: Why nonblocking I/O in Java is hard

2000-06-12 Thread Joseph Shraibman
Matt Welsh wrote: > > Juergen Kreileder <[EMAIL PROTECTED]> writes: > > > "Matt" == Matt Welsh <[EMAIL PROTECTED]> writes: > > > > Matt> Turns out this is not as easy as it could be -- because even > > Matt> though you call system calls like read(), write(), and > > Matt> fcntl()

Re: Why nonblocking I/O in Java is hard

2000-06-12 Thread Matt Welsh
Juergen Kreileder <[EMAIL PROTECTED]> writes: > > "Matt" == Matt Welsh <[EMAIL PROTECTED]> writes: > > Matt> Turns out this is not as easy as it could be -- because even > Matt> though you call system calls like read(), write(), and > Matt> fcntl() from native code, these are tra

Re: Why nonblocking I/O in Java is hard

2000-06-12 Thread Juergen Kreileder
> "Matt" == Matt Welsh <[EMAIL PROTECTED]> writes: Matt> Turns out this is not as easy as it could be -- because even Matt> though you call system calls like read(), write(), and Matt> fcntl() from native code, these are trapped by the Java Matt> runtime library to do magic th

Re: Why nonblocking I/O in Java is hard

2000-06-11 Thread Matt Welsh
Dimitris Vyzovitis <[EMAIL PROTECTED]> writes: > > Isn't that a bit dangerous? Well - anything you do with native code in Java is inherently "dangerous". Obviously it's best to use native threads when doing this kind of thing, but I want compatibility with green threads in case people need tha

Re: Why nonblocking I/O in Java is hard

2000-06-11 Thread Dimitris Vyzovitis
Matt Welsh wrote: In other words, although I was creating a nonblocking socket and issuing read calls against it in JNI-based C code, those system calls (from C) were in fact being caught by the Java runtime library which was turning them back into "blocking" access to the socket. This is because