From: Matthew Shapiro Date: 2002-06-05T05:34:59+09:00 Subject: Re: keyboard input Where can I find information of Ruby's IO class? And what do you mean by C libraries? was ruby made in C? --KallDrexx ------ Original Message ----- From: Yohanes Santoso Date: Wed, 5 Jun 2002 04:58:22 +0900 To: ruby-talk@ruby-lang.org (ruby-talk ML) Subject: Re: keyboard input > "Matthew Shapiro" writes: > > > keyboard input in a non-blocking way. One thing that I have been > > thinking was using multithreading (which looks amazingly easy in > > ruby) and use the .collect() function, but does this block? > > As long as you use the IO functions from the IO class, ruby won't > block. > > > Also will it pick up keys like the up arrow? > > That depends on what the C library returns you. If your C library > allows you to pick up the up arrow key using getc, then ditto for > IO#getc. > > Now, if my reading of eval.c and *sig* is correct, then the thread > granularity of ruby is per AST node, and if a node takes more than 500 > ticks (of what?, of system's timer interrupt?), then it is pre-empted > except if Thread#critical is set. > > Am I correct? > > YS. > ----KallDrexx -- _______________________________________________ Sign-up for your own FREE Personalized E-mail at Mail.com http://www.mail.com/?sr=signup