comp.lang.ada
 help / color / mirror / Atom feed
* Rational APEX Ada95 w/  X11R6
@ 1999-06-15  0:00 Brian Kelly
  1999-06-15  0:00 ` dennison
  1999-06-16  0:00 ` Simon Wright
  0 siblings, 2 replies; 8+ messages in thread
From: Brian Kelly @ 1999-06-15  0:00 UTC (permalink / raw)


Has anyone programmed using Rational's Ada95 compiler and X11R6?

If so, have you come up w/ any concurrency issues/problems?

I'm currently looking into the feasability of putting these two products
together for future products.

Thank you,

Brian Kelly.






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

* Re: Rational APEX Ada95 w/ X11R6
  1999-06-15  0:00 Rational APEX Ada95 w/ X11R6 Brian Kelly
@ 1999-06-15  0:00 ` dennison
  1999-06-16  0:00   ` Matthew Heaney
  1999-06-16  0:00 ` Simon Wright
  1 sibling, 1 reply; 8+ messages in thread
From: dennison @ 1999-06-15  0:00 UTC (permalink / raw)


In article <929466176.893.35@news.remarQ.com>,
  "Brian Kelly" <Brian.Kelly@TVL2000.com> wrote:
> Has anyone programmed using Rational's Ada95 compiler and X11R6?
>
> If so, have you come up w/ any concurrency issues/problems?
>
> I'm currently looking into the feasability of putting these two
products
> together for future products.

More specifics would help. For instance, you will need bindings to X.
Some very literal (or "thin") bindings are available, as are some
thicker ones that do nifty things like synchornize access so that the
calls are task-safe. But what's available to you depends on your
compiler/OS combination.

--
T.E.D.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.




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

* Re: Rational APEX Ada95 w/ X11R6
  1999-06-16  0:00     ` dennison
@ 1999-06-16  0:00       ` Matthew Heaney
  1999-06-16  0:00         ` dennison
  0 siblings, 1 reply; 8+ messages in thread
From: Matthew Heaney @ 1999-06-16  0:00 UTC (permalink / raw)


On 16 Jun 1999 15:17, dennison@telepath.com wrote:

> > No.  All the C calls to X/Motif can be done by a thin C layer, called
> 
> In which case you would instead need bindings to the "thin C layer"...

Yes, but that number is small compared to the number of X calls in a
typical X client.








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

* Re: Rational APEX Ada95 w/ X11R6
  1999-06-16  0:00       ` Matthew Heaney
@ 1999-06-16  0:00         ` dennison
  0 siblings, 0 replies; 8+ messages in thread
From: dennison @ 1999-06-16  0:00 UTC (permalink / raw)


In article <m3hfo8ozc7.fsf@mheaney.ni.net>,
  Matthew Heaney <matthew_heaney@acm.org> wrote:
> On 16 Jun 1999 15:17, dennison@telepath.com wrote:
>
> > > No.  All the C calls to X/Motif can be done by a thin C layer,
called
> >
> > In which case you would instead need bindings to the "thin C
layer"...
>
> Yes, but that number is small compared to the number of X calls in a
> typical X client.

If you are doing X-level programming, perhaps. You can achieve the same
end with Motif by using UIL to specify the initial configuration of all
your windows. Then there's only a very small number of X/Motif calls you
need to make. If I remember correctly, you need a couple of Xt calls
(Initialize the application, main event loop), three MRM calls
(initialize, load the hierarchy from disk, get a handle for a given
widget name), and one MRM call for each widget-manipulation routine you
use. Its actually small enough where its hardly worth even buying
bindings. You can just write them as you need them.


--
T.E.D.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.




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

* Re: Rational APEX Ada95 w/  X11R6
  1999-06-15  0:00 Rational APEX Ada95 w/ X11R6 Brian Kelly
  1999-06-15  0:00 ` dennison
@ 1999-06-16  0:00 ` Simon Wright
  1 sibling, 0 replies; 8+ messages in thread
From: Simon Wright @ 1999-06-16  0:00 UTC (permalink / raw)


"Brian Kelly" <Brian.Kelly@TVL2000.com> writes:

> Has anyone programmed using Rational's Ada95 compiler and X11R6?
> 
> If so, have you come up w/ any concurrency issues/problems?

No, but we have used GNAT and VADS (SunSoft Ada). You will likely find
that your out-of-the-box X11R6 hasn't been built with thread
awareness; see XInitThreads(3), XtToolkitThreadInitialize(3). In that
case, you must make sure that each of your Displays is only accessed
by one task. I don't think it would be safe to provide your own
serialization, since your widgets are relying on X events being
dispatched to them and the X events (eg Button1Down) are not under
your control.

NB, you can have more than one Display connection to the same server ..




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

* Re: Rational APEX Ada95 w/ X11R6
  1999-06-15  0:00 ` dennison
@ 1999-06-16  0:00   ` Matthew Heaney
  1999-06-16  0:00     ` dennison
  1999-06-17  0:00     ` Simon Wright
  0 siblings, 2 replies; 8+ messages in thread
From: Matthew Heaney @ 1999-06-16  0:00 UTC (permalink / raw)


On 15 Jun 1999 20:25, dennison@telepath.com wrote:

> In article <929466176.893.35@news.remarQ.com>,
>   "Brian Kelly" <Brian.Kelly@TVL2000.com> wrote:
> > Has anyone programmed using Rational's Ada95 compiler and X11R6?
> >
> > If so, have you come up w/ any concurrency issues/problems?
> >
> > I'm currently looking into the feasability of putting these two
> products
> > together for future products.
> 
> More specifics would help. 

I think he is refering to the fact that in R6, you can run the X main
loop inside its own thread.

How do you do this in Ada95?  In other words, how can you run the X main
loop inside its own Ada task?

Does R6 specify what kind of thread runs the main loop?  I thought it
specified a "Posix thread."  If so, how do you guarantee that an Ada
task maps to a Posix thread?


> For instance, you will need bindings to X.

No.  All the C calls to X/Motif can be done by a thin C layer, called by
a high-level infrastructure written in Ada95.  There's no need for Ada
bindings to the toolkit directly.


> Some very literal (or "thin") bindings are available, as are some
> thicker ones that do nifty things like synchornize access so that the
> calls are task-safe.

Stay away from thick bindings that "synchronize access so that calls are
task-safe."  This doesn't work.  Stay away from thick bindings.  Stay
away from bindings.


> But what's available to you depends on your compiler/OS combination.

This is a restatement of the original question.





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

* Re: Rational APEX Ada95 w/ X11R6
  1999-06-16  0:00   ` Matthew Heaney
@ 1999-06-16  0:00     ` dennison
  1999-06-16  0:00       ` Matthew Heaney
  1999-06-17  0:00     ` Simon Wright
  1 sibling, 1 reply; 8+ messages in thread
From: dennison @ 1999-06-16  0:00 UTC (permalink / raw)


In article <m3so7spj4t.fsf@mheaney.ni.net>,
  Matthew Heaney <matthew_heaney@acm.org> wrote:
> On 15 Jun 1999 20:25, dennison@telepath.com wrote:
>
>
> > For instance, you will need bindings to X.
>
> No.  All the C calls to X/Motif can be done by a thin C layer, called
by

In which case you would instead need bindings to the "thin C layer"...

--
T.E.D.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.




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

* Re: Rational APEX Ada95 w/ X11R6
  1999-06-16  0:00   ` Matthew Heaney
  1999-06-16  0:00     ` dennison
@ 1999-06-17  0:00     ` Simon Wright
  1 sibling, 0 replies; 8+ messages in thread
From: Simon Wright @ 1999-06-17  0:00 UTC (permalink / raw)


Matthew Heaney <matthew_heaney@acm.org> writes:

> I think he is refering to the fact that in R6, you can run the X main
> loop inside its own thread.
> 
> How do you do this in Ada95?  In other words, how can you run the X main
> loop inside its own Ada task?
> 
> Does R6 specify what kind of thread runs the main loop?  I thought it
> specified a "Posix thread."  If so, how do you guarantee that an Ada
> task maps to a Posix thread?

It has always been possible to run the X main loop in a task (well, in
DEC VAX Ada 83, Sunsoft (VADS), GNAT on Solaris, Linux, OSF
anyway). The problems arise if you want other threads to access the
Display(s) that your main loop is controlling.

X11 doesn't have a main loop, does it? This an Xt function ..

> Stay away from thick bindings that "synchronize access so that calls are
> task-safe."  This doesn't work.  Stay away from thick bindings.  Stay
> away from bindings.

If you build X11R6 with threads enabled, which is the default on some
Linux platforms, and you initialize thread support in X and Xt, then
calls are task-safe.

> No.  All the C calls to X/Motif can be done by a thin C layer, called by
> a high-level infrastructure written in Ada95.  There's no need for Ada
> bindings to the toolkit directly.

Or you could rewrite the whole binding in Ada :-) I did this for (the
most interesting 25% of) X11R5 Xlib for Rational R1000 some years ago,
an interesting exercise but really only useful to make people sit up
and take notice.

-- 
Simon Wright                        Work Email: simon.j.wright@gecm.com
Alenia Marconi Systems                         Voice: +44(0)1705-701778
Integrated Systems Division                      FAX: +44(0)1705-701800




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

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

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-06-15  0:00 Rational APEX Ada95 w/ X11R6 Brian Kelly
1999-06-15  0:00 ` dennison
1999-06-16  0:00   ` Matthew Heaney
1999-06-16  0:00     ` dennison
1999-06-16  0:00       ` Matthew Heaney
1999-06-16  0:00         ` dennison
1999-06-17  0:00     ` Simon Wright
1999-06-16  0:00 ` Simon Wright

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