comp.lang.ada
 help / color / mirror / Atom feed
From: "SteveD" <nospam_steved94@attbi.com>
Subject: Re: Waiting for callbacks from dll on Win32
Date: Sat, 09 Nov 2002 04:30:58 GMT
Date: 2002-11-09T04:30:58+00:00	[thread overview]
Message-ID: <6c0z9.24316$Dc4.90485@rwcrnsc51.ops.asp.att.net> (raw)
In-Reply-To: aTTx9.482$0d2.1468@nntpserver.swip.net

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1254 bytes --]

"Bj�rn Lundin" <bjorn.lundin.nospam@swipnet.se> wrote in message
news:aTTx9.482$0d2.1468@nntpserver.swip.net...
> Stephen Leake wrote:
>
> > Bj�rn Lundin <bjorn.lundin.nospam@swipnet.se> writes:
> >
[snip]
> > Wrap the protected object call in a "normal" procedure, and use that
> > as the callback.
> >
> > Even then, you have to worry about the Ada tasking vs the C tasking.
> > If you have an Ada main, you are probably ok.
> >
>
> Thanks, it seems to have solved my main problem, now it's
> just to make a real application of it...

I faced a similar problem with ObjectAda.  In my case the callback was from
an RSLinx communication library.  I found that if I attempted a protected
operation in the callback, bad things happened.

Apparently the Ada runtime for ObjectAda requires special infomation to be
set up for tasks that interact with protected objects or Ada tasks.

I worked around the problem using shared memory and a couple of windows
semaphores.  ObjectAda didn't have any problems when the Ada tasks wait on
OS objects.

I believe GNAT addresses this problem by creating a special task environment
for C callbacks such that you can use Ada tasking constructs seamlessly.

I hope this helps,
SteveD

>
> Thanks again
> /Bj�rn





  reply	other threads:[~2002-11-09  4:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-04 20:46 Waiting for callbacks from dll on Win32 Björn Lundin
2002-11-04 21:09 ` Stephen Leake
2002-11-05 17:58   ` Warren W. Gay VE3WWG
2002-11-05 18:16     ` Björn Lundin
2002-11-05 18:33       ` Warren W. Gay VE3WWG
2002-11-06  8:23         ` Pascal Obry
2002-11-06 16:39           ` Björn Lundin
2002-11-05 18:15   ` Björn Lundin
2002-11-09  4:30     ` SteveD [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-11-07  5:46 Grein, Christoph
2002-11-07 19:26 ` Björn Lundin
replies disabled

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