From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e759c9142eba3ec1 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-02-20 13:05:06 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!feed1.news.rcn.net!rcn!logbridge.uoregon.edu!msunews!not-for-mail From: "Chad R. Meiners" Newsgroups: comp.lang.ada Subject: Re: Keyboard Polling Solution Date: Fri, 20 Feb 2004 15:59:12 -0500 Organization: Michigan State University Message-ID: References: <4033DB01.2CE34E32@me.org> <4034A229.8080403@noplace.com> <40354027.C7D28149@mchsi.com> <4035FA69.1060301@noplace.com> NNTP-Posting-Host: arctic.cse.msu.edu X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Xref: archiver1.google.com comp.lang.ada:5698 Date: 2004-02-20T15:59:12-05:00 List-Id: "Marin David Condic" wrote in message news:4035FA69.1060301@noplace.com... > I'd be curious why you want to poll. Usually, one tries to avoid that, > but I know I've wanted something going on in the background that might > stop when the user hit a key. The usual trick would be to have a task > looking at keyboard input with another task doing the background job. > Sometimes this wouldn't work with some implementations because the I/O > operation didn't flag the task as "blocked", so the background would > starve. Then you might want to resort to some kind of polling. When writing a keyboard task, I usually poll the keyboard and then delay or sleep on a select statement. This way I can send commands to the keyboard task if need be. -CRM