comp.lang.ada
 help / color / mirror / Atom feed
* Signals from ethernet card driver
@ 1999-04-29  0:00 askeya
  1999-04-30  0:00 ` Tarjei Tj�stheim Jensen
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: askeya @ 1999-04-29  0:00 UTC (permalink / raw)


I am not sure if this is a Solaris or an Ada question so I'll post to
both places.

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?

Second question:  In theory, can I receive that signal in my program?

Third question (if you feel ambitious): In general, how?

Thanx.
-- 
---------------------------------------------------
|                 Andy Askey                      |
|              Software Engineer                  |
|           Raytheon Systems Company              |
|   670 Discovery Drive, Huntsville, AL  35806    |
|   Phone: (256) 971-2367  Fax: (256) 971-2306    |
|        andrew_j_askey@res.raytheon.com          |
---------------------------------------------------




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Signals from ethernet card driver
  1999-04-29  0:00 Signals from ethernet card driver askeya
  1999-04-30  0:00 ` Tarjei Tj�stheim Jensen
  1999-04-30  0:00 ` askeya
@ 1999-04-30  0:00 ` dennison
  1999-04-30  0:00   ` Larry Kilgallen
  1999-04-30  0:00 ` Matthew Heaney
  1999-05-27  0:00 ` Vincent Amiot
  4 siblings, 1 reply; 9+ messages in thread
From: dennison @ 1999-04-30  0:00 UTC (permalink / raw)


In article <3728E864.C1BAB081@res.raytheon.com>,
  askeya <askeya@res.raytheon.com> wrote:

> 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.

> Second question:  In theory, can I receive that signal in my program?
>
> Third question (if you feel ambitious): In general, how?

Before these 2 questions can be answered, you'll have to answer one of ours:
What Ada compiler are you using?

--
T.E.D.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Signals from ethernet card driver
  1999-04-30  0:00 ` dennison
@ 1999-04-30  0:00   ` Larry Kilgallen
  0 siblings, 0 replies; 9+ messages in thread
From: Larry Kilgallen @ 1999-04-30  0:00 UTC (permalink / raw)


In article <7gcfho$qqu$1@nnrp1.dejanews.com>, dennison@telepath.com writes:
> In article <3728E864.C1BAB081@res.raytheon.com>,
>   askeya <askeya@res.raytheon.com> wrote:
> 
>> 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.
> 
>> Second question:  In theory, can I receive that signal in my program?
>>
>> Third question (if you feel ambitious): In general, how?
> 
> Before these 2 questions can be answered, you'll have to answer one of ours:
> What Ada compiler are you using?

But if there is no answer for some compiler, I would be interested
in hearing the answer for some other compiler, since I don't have a
Sun compiler yet :-).

Larry Kilgallen




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Signals from ethernet card driver
  1999-04-29  0:00 Signals from ethernet card driver askeya
@ 1999-04-30  0:00 ` Tarjei Tj�stheim Jensen
  1999-04-30  0:00 ` askeya
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Tarjei Tj�stheim Jensen @ 1999-04-30  0:00 UTC (permalink / raw)




askeya wrote:

> I am not sure if this is a Solaris or an Ada question so I'll post to
> both places.
>
> 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?
>
> Second question:  In theory, can I receive that signal in my program?
>
> Third question (if you feel ambitious): In general, how?

Why not use sockets? I suppose forrest (available at various net sites which
carries ada source) would do nicely. I would even assume that your ada
environment/compiler comes with the neccessary definitions to use sockets.


Greetings,








^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Signals from ethernet card driver
  1999-04-29  0:00 Signals from ethernet card driver askeya
                   ` (2 preceding siblings ...)
  1999-04-30  0:00 ` dennison
@ 1999-04-30  0:00 ` Matthew Heaney
  1999-05-03  0:00   ` Vincent P. Amiot
  1999-05-27  0:00 ` Vincent Amiot
  4 siblings, 1 reply; 9+ messages in thread
From: Matthew Heaney @ 1999-04-30  0:00 UTC (permalink / raw)


askeya <askeya@res.raytheon.com> 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.









^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Signals from ethernet card driver
  1999-04-29  0:00 Signals from ethernet card driver askeya
  1999-04-30  0:00 ` Tarjei Tj�stheim Jensen
@ 1999-04-30  0:00 ` askeya
  1999-04-30  0:00 ` dennison
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: askeya @ 1999-04-30  0:00 UTC (permalink / raw)


I am using the latest version of Rational Apex and the compiler that
comes with.

askeya wrote:
> 
> I am not sure if this is a Solaris or an Ada question so I'll post to
> both places.
> 
> 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?
> 
> Second question:  In theory, can I receive that signal in my program?
> 
> Third question (if you feel ambitious): In general, how?
> 
> Thanx.

-- 
---------------------------------------------------
|                 Andy Askey                      |
|              Software Engineer                  |
|           Raytheon Systems Company              |
|   670 Discovery Drive, Huntsville, AL  35806    |
|   Phone: (256) 971-2367  Fax: (256) 971-2306    |
|        andrew_j_askey@res.raytheon.com          |
---------------------------------------------------




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Signals from ethernet card driver
  1999-04-30  0:00 ` Matthew Heaney
@ 1999-05-03  0:00   ` Vincent P. Amiot
  1999-05-07  0:00     ` askeya
  0 siblings, 1 reply; 9+ messages in thread
From: Vincent P. Amiot @ 1999-05-03  0:00 UTC (permalink / raw)


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 <matthew_heaney@acm.org> wrote in article
<m3yajar74r.fsf@mheaney.ni.net>...
> askeya <askeya@res.raytheon.com> 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<T
M#0I414P[4$%'15([5D])0T4Z*#8Q.2D@,C4S(#$X,S8-"E1%3#M73U)+.T9!
M6#HH-C$Y*2 X,C0@,#(Q,@T*0412.U=/4DLZ.SLU,#0P(%-H;W)E:&%M(%!L
M.U-A;B!$:65G;SM#83LY,C$R,CM54T$-"DQ!0D5,.U=/4DL[14Y#3T1)3D<]
M455/5$5$+5!224Y404),13HU,#0P(%-H;W)E:&%M(%!L/3!$/3!!4V%N($1I
M96=O+"!#82 Y,C$R,CTP1#TP055300T*55),.@T*55),.FAT=' Z+R]W=W<N
M86]N:7@N8V]M#0I%34%)3#M04D5&.TE.5$523D54.G9A;6EO=$!A;VYI>"YC
E;VT-"E)%5CHQ.3DY,#4P,U0R,S0S-3!:#0I%3D0Z5D-!4D0-"D!A
`
end





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Signals from ethernet card driver
  1999-05-03  0:00   ` Vincent P. Amiot
@ 1999-05-07  0:00     ` askeya
  0 siblings, 0 replies; 9+ messages in thread
From: askeya @ 1999-05-07  0:00 UTC (permalink / raw)


Thanx for all the input.  These ideas have really helped out design
process.

---------------------------------------------------
|                 Andy Askey                      |
|              Software Engineer                  |
|           Raytheon Systems Company              |
|   670 Discovery Drive, Huntsville, AL  35806    |
|   Phone: (256) 971-2367  Fax: (256) 971-2306    |
|        andrew_j_askey@res.raytheon.com          |
---------------------------------------------------




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Signals from ethernet card driver
  1999-04-29  0:00 Signals from ethernet card driver askeya
                   ` (3 preceding siblings ...)
  1999-04-30  0:00 ` Matthew Heaney
@ 1999-05-27  0:00 ` Vincent Amiot
  4 siblings, 0 replies; 9+ messages in thread
From: Vincent Amiot @ 1999-05-27  0:00 UTC (permalink / raw)


askeya wrote:

> I am not sure if this is a Solaris or an Ada question so I'll post to
> both places.
>
> 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?

On non multithreaded systems SIGIO can generally be generated by an
activity on the socket

>
>
> Second question:  In theory, can I receive that signal in my program?
>

See Attach_Handler / Interrupt_Handler pragmas/subprograms

>
> Third question (if you feel ambitious): In general, how?
>

as usual: with care & determination!

>
> Thanx.
> --
> ---------------------------------------------------
> |                 Andy Askey                      |
> |              Software Engineer                  |
> |           Raytheon Systems Company              |
> |   670 Discovery Drive, Huntsville, AL  35806    |
> |   Phone: (256) 971-2367  Fax: (256) 971-2306    |
> |        andrew_j_askey@res.raytheon.com          |
> ---------------------------------------------------





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~1999-05-27  0:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-04-29  0:00 Signals from ethernet card driver askeya
1999-04-30  0:00 ` Tarjei Tj�stheim Jensen
1999-04-30  0:00 ` askeya
1999-04-30  0:00 ` dennison
1999-04-30  0:00   ` Larry Kilgallen
1999-04-30  0:00 ` Matthew Heaney
1999-05-03  0:00   ` Vincent P. Amiot
1999-05-07  0:00     ` askeya
1999-05-27  0:00 ` Vincent Amiot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox