Keyboard input


(Matthew Shapiro) #1

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 ruby-talk@jenny-gnome.dyndns.org
Date: Wed, 5 Jun 2002 04:58:22 +0900
To: ruby-talk@ruby-lang.org (ruby-talk ML)
Subject: Re: keyboard input

“Matthew Shapiro” kalldrexx@programmer.net 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


(Kent Dahl) #2

Matthew Shapiro wrote:

Where can I find information of Ruby’s IO class?

http://www.rubycentral.com/book/builtins.html

And what do you mean by C libraries? was ruby made in C?

peeks in the source

Yup.

···


([ Kent Dahl ]/)_ ~ [ http://www.stud.ntnu.no/~kentda/ ]/~
))_student
/(( _d L b_/ NTNU - graduate engineering - 4. year )
( __õ|õ// ) )Industrial economics and technological management(
_
/ö____/ (_engineering.discipline=Computer::Technology)