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=3.8 required=5.0 tests=BAYES_00,INVALID_MSGID, RATWARE_MS_HASH,RATWARE_OUTLOOK_NONAME autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,50b338b69088ffa3 X-Google-Attributes: gid103376,public From: "Vincent P. Amiot" Subject: Re: Signals from ethernet card driver Date: 1999/05/03 Message-ID: <01be95be$f5bece40$3503af88@alesia>#1/1 X-Deja-AN: 473698925 Sender: news@sd.aonix.com (USENET News Admin @flash) X-Nntp-Posting-Host: dhcp-3.53 References: <3728E864.C1BAB081@res.raytheon.com> Organization: Aonix Newsgroups: comp.lang.ada Date: 1999-05-03T00:00:00+00:00 List-Id: SIGIO can be used on UNIX non-multithreaded systems not to have to resort to polling... But on multi-threaded systems that do map Ada tasks onto threads/LWP your best bet is to dedicate a thread that would block itself on a READ (a blocking call actually stops the thread on a semaphore, the semaphore is 'signaled' in the driver itself and the thread released... This alleviate the need for setting a handler in user code that will in turn (through some high level Ada interface) signal a semaphore/CV through a system call etc... To summarize SIGIO is great but only for non-multithreaded applications, if you need more details about out to set it up, get back to me... Vincent Amiot Principal Consultant / Aonix Tel: (619) 253 1836 -- Matthew Heaney wrote in article ... > askeya writes: > > > I am trying to get a driver to signal my Ada program when a TCP/IP > > message arrives over an ethernet on a Sun running Solaris 2.7. It would > > be great if the signal would act as a task rendezvous. I have done this > > on a VAX with VMS using Starlet, but don't have a clue if it can be done > > on a Sun with Solaris. > > > > First question: can the driver send a signal when a message arrives? > > I'm not very driver-literate, but does the client do the I/O using a > file descriptor? Won't SIGIO (SIGPOLL) work? > > > Second question: In theory, can I receive that signal in my program? > > Try declaring an interrupt handler to catch the signal SIGIO (SIGPOLL). > > > Third question (if you feel ambitious): In general, how? > > In Ada95, you declare an interrupt handler as a protected procedure, and > bind it to a signal via pragma Interrupt_Handler. > > Although it's officially obsolescent, you can also bind an interrupt > handler to a task entry. > > > > > > begin 600 Vincent P. Amiot.vcf M0D5'24XZ5D-!4D0-"E9%4E-)3TXZ,BXQ#0I..D%M:6]T.U9I;F-E;G0[4"X- M"D9..E9I;F-E;G0@4"X@06UI;W0-"D]21SI!;VYI> T*5$E43$4Z4')I;F-I M<&%L($-O;G-U;'1A;G0-"E1%3#M73U)+.U9/24-%.B@V,3DI(#@R-" P,S