comp.lang.ada
 help / color / mirror / Atom feed
* Re: Tasks in Gnat3.05 for Dos?
  1996-07-16  0:00 Tasks in Gnat3.05 for Dos? Spasmo
@ 1996-07-16  0:00 ` John S. Harbaugh
  1996-07-17  0:00   ` Spasmo
  0 siblings, 1 reply; 10+ messages in thread
From: John S. Harbaugh @ 1996-07-16  0:00 UTC (permalink / raw)



Spasmo wrote:
> 
> Hi.
> 
> As some may know I'm running Gnat3.05 for DOS (in a DOS box
> in Win95 to be precise) and I'm trying to compile some simple
> code that uses tasks.  Well it compiles fine, but when it
> tries to link it gives me the error "can't find -lgthreads".
> 
> Now I've gotten the stuff from the lglwww site (that main Ada
> site), and I've used ginstall to install, read the docs so
> that my environment was set, and checked around on my
> hardrive for any file resembling that name but to no avail.
> 
> So my question is, is there something missing from my
> implementation, or is tasking not implemented
> in this version, and if so why do they even let us compile
> code with tasks in it?
> 
> Thanks in advance.
> 
> --
> Spasmo
> "Here's a present just for you
> When you open it, you'll be through"
>         "Letter Bomb" by the Circle Jerks


This common problem and others are documented in Readme.dos.  You will 
find it in your gnat305 directory.

"3) When running under Windows 95 you may have to rename libgthre.a or
libgth~1.a to libgthreads.a in order for the linker to find it."

Best regards,

	-John Harbaugh
The Boeing Company
"This disclaimer is not legally binding"




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

* Tasks in Gnat3.05 for Dos?
@ 1996-07-16  0:00 Spasmo
  1996-07-16  0:00 ` John S. Harbaugh
  0 siblings, 1 reply; 10+ messages in thread
From: Spasmo @ 1996-07-16  0:00 UTC (permalink / raw)



Hi.

As some may know I'm running Gnat3.05 for DOS (in a DOS box
in Win95 to be precise) and I'm trying to compile some simple
code that uses tasks.  Well it compiles fine, but when it
tries to link it gives me the error "can't find -lgthreads".

Now I've gotten the stuff from the lglwww site (that main Ada
site), and I've used ginstall to install, read the docs so
that my environment was set, and checked around on my
hardrive for any file resembling that name but to no avail.

So my question is, is there something missing from my
implementation, or is tasking not implemented
in this version, and if so why do they even let us compile
code with tasks in it?

Thanks in advance.

--
Spasmo
"Here's a present just for you
When you open it, you'll be through"
	"Letter Bomb" by the Circle Jerks





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

* Re: Tasks in Gnat3.05 for Dos?
  1996-07-17  0:00   ` Spasmo
@ 1996-07-17  0:00     ` Robert Dewar
  1996-07-21  0:00       ` Spasmo
  1996-07-23  0:00       ` Jon S Anthony
  0 siblings, 2 replies; 10+ messages in thread
From: Robert Dewar @ 1996-07-17  0:00 UTC (permalink / raw)



"Yep found that out (how I missed it I'll never know).  Now it
compiles and runs, but the tasks don't run concurrently :("

Of course they don't run concurrently, you are on a single processor
machine. Furthermore, in accordance with the required semantics of
the real time annex, the scheduling is run-till-blocked. If you
are thinking that I/O should be overlapped -- you won't get this
in DOS, DOS does not take kindly to multi-threading.

What exactly are you expecting that you do not see?





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

* Re: Tasks in Gnat3.05 for Dos?
  1996-07-16  0:00 ` John S. Harbaugh
@ 1996-07-17  0:00   ` Spasmo
  1996-07-17  0:00     ` Robert Dewar
  0 siblings, 1 reply; 10+ messages in thread
From: Spasmo @ 1996-07-17  0:00 UTC (permalink / raw)



John S. Harbaugh (johnh@bunsen.ds.boeing.com) wrote:
: Spasmo wrote:
: > 

[Snip]

: This common problem and others are documented in Readme.dos.  You will 
: find it in your gnat305 directory.

: "3) When running under Windows 95 you may have to rename libgthre.a or
: libgth~1.a to libgthreads.a in order for the linker to find it."

Yep found that out (how I missed it I'll never know).  Now it
compiles and runs, but the tasks don't run concurrently :(


: Best regards,

: 	-John Harbaugh
: The Boeing Company
: "This disclaimer is not legally binding"

--
Spasmo
"Here's a present just for you
When you open it, you'll be through"
	"Letter Bomb" by the Circle Jerks





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

* Re: Tasks in Gnat3.05 for Dos?
  1996-07-17  0:00     ` Robert Dewar
@ 1996-07-21  0:00       ` Spasmo
  1996-07-21  0:00         ` Michael Feldman
  1996-07-22  0:00         ` John Harbaugh
  1996-07-23  0:00       ` Jon S Anthony
  1 sibling, 2 replies; 10+ messages in thread
From: Spasmo @ 1996-07-21  0:00 UTC (permalink / raw)



Robert Dewar (dewar@cs.nyu.edu) wrote:
: "Yep found that out (how I missed it I'll never know).  Now it
: compiles and runs, but the tasks don't run concurrently :("

: Of course they don't run concurrently, you are on a single processor
: machine. Furthermore, in accordance with the required semantics of
: the real time annex, the scheduling is run-till-blocked. If you
: are thinking that I/O should be overlapped -- you won't get this
: in DOS, DOS does not take kindly to multi-threading.

: What exactly are you expecting that you do not see?

Timeslicing.  IN any case that's not to be as many folks have told
me, and now that I've started working on some tasking code, I find
that it's actually a good thing since it's better that I implement
my own atomic slicing based on units of work via different entries.


--
Spasmo
"Here's a present just for you
When you open it, you'll be through"
	"Letter Bomb" by the Circle Jerks





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

* Re: Tasks in Gnat3.05 for Dos?
  1996-07-21  0:00       ` Spasmo
@ 1996-07-21  0:00         ` Michael Feldman
  1996-07-22  0:00         ` John Harbaugh
  1 sibling, 0 replies; 10+ messages in thread
From: Michael Feldman @ 1996-07-21  0:00 UTC (permalink / raw)



In article <4su2km$dt4@masala.cc.uh.edu>, Spasmo <cosc19z5@Bayou.UH.EDU> wrote:

>Timeslicing.  IN any case that's not to be as many folks have told
>me, and now that I've started working on some tasking code, I find
>that it's actually a good thing since it's better that I implement
>my own atomic slicing based on units of work via different entries.

Yes, I think you'll end up writing better concurrent programs that way.
They will be independent of the underlying RT and OS dispatching, 
and that sort of program is just one of the key things Ada's high-level
tasking constructs were designed for.

And writing that sort of platform-independent concurrent program
in C, say, is very difficult, nigh-on impossible, in the current state 
of threads implementations. 

At some point, POSIX threads may make this easier. In the meantime,
note that GNAT tasking is implemented over whatever threads library
is available, which means a bunch of system-independent stuff in the
runtime. Aren't you glad all that threads stuff is taken care
of by the GNAT runtime, instead of your having to write it yourself,
program by program?

  * * * * *

Allow me one anecdote. I recently finished teaching a course in which 
the semester project was to develop a software simulation for a part of
a rapid transit system such as the Washington area's Metrorail.
(Metrorail really does operate under automatic control, BTW.)

I set an overall goal of developing a nice object model for trains,
tracks, stations, control points, etc., and students were to exploit
the platform-independent tasking model to the greatest extent
possible.

One especially nice 2-person project used a character-based display,
and drew a rough map of the rail ines at the top, with little
scrolling windows at the bottom to give status reports on the
movements of the trains. This project was full of tasks and
protected types.

The students developed this on Solaris. After the course was over, I 
decided to download their code and use it as a shakedown of tasking on
DOS, which had just been completed. It compiled and ran the first time,
without changing a single character of source code!

Two weeks ago I got _really_ bold, and decided to try out the tasking
using the GNAT-MachTen for Mac. Tasking had just been (mostly) completed.
Yep, the Metrorail project compiled and ran the first time, again
without changing a single character of source code.

I was extremely pleased, though not terribly surprised, because over
the last ten years I've really come to appreciate the power of the Ada
"concurrent object" model, and how easy it is to write really
platform-independent concurrent programs. 

If anyone is interested, I just put a paper on the Metrorail project
on the Web at 

http://www.seas.gwu.edu/seas/eecs/Research/ada/metro/metro.html

Comments welcome.

Mike Feldman




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

* Re: Tasks in Gnat3.05 for Dos?
  1996-07-21  0:00       ` Spasmo
  1996-07-21  0:00         ` Michael Feldman
@ 1996-07-22  0:00         ` John Harbaugh
  1996-07-23  0:00           ` Robert A Duff
  1 sibling, 1 reply; 10+ messages in thread
From: John Harbaugh @ 1996-07-22  0:00 UTC (permalink / raw)



Spasmo wrote:
> 
> Robert Dewar (dewar@cs.nyu.edu) wrote:
> : "Yep found that out (how I missed it I'll never know).  Now it
> : compiles and runs, but the tasks don't run concurrently :("
> 
> : Of course they don't run concurrently, you are on a single processor
> : machine. Furthermore, in accordance with the required semantics of
> : the real time annex, the scheduling is run-till-blocked. If you
> : are thinking that I/O should be overlapped -- you won't get this
> : in DOS, DOS does not take kindly to multi-threading.
> 
> : What exactly are you expecting that you do not see?
> 
> Timeslicing.  IN any case that's not to be as many folks have told
> me, and now that I've started working on some tasking code, I find
> that it's actually a good thing since it's better that I implement
> my own atomic slicing based on units of work via different entries.
> 
> --
> Spasmo
> "Here's a present just for you
> When you open it, you'll be through"
>         "Letter Bomb" by the Circle Jerks

In their excellent book "Concurrency In Ada" Burns and Welling make a useful 
distinction between parallelism and concurrency:

"Two processes are said to be executing in parallel if at any instant they 
are both executing...  By comparison, two processes are said to be concurrent 
if they have the potential for executing in parallel."

The important principal is concurrancy.  A concurrent program will run 
correctly on one or many processors, or even a distributed heterogeneous 
network.  Performance depends on the actual hardware, of course.  Timeslicing 
is really just a way of simulating multiple processors.  A correct concurrent 
program will make no assumptions about the number of processors available.

	- John Harbaugh
	The Boeing Company
"Message disclaimers are not legally binding"




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

* Re: Tasks in Gnat3.05 for Dos?
  1996-07-22  0:00         ` John Harbaugh
@ 1996-07-23  0:00           ` Robert A Duff
  1996-07-24  0:00             ` John Harbaugh
  0 siblings, 1 reply; 10+ messages in thread
From: Robert A Duff @ 1996-07-23  0:00 UTC (permalink / raw)



In article <31F3E4E7.13E4@bunsen.ds.boeing.com>,
John Harbaugh  <johnh@bunsen.ds.boeing.com> wrote:
>In their excellent book "Concurrency In Ada" Burns and Welling make a useful 
>distinction between parallelism and concurrency:
>
>"Two processes are said to be executing in parallel if at any instant they 
>are both executing...  By comparison, two processes are said to be concurrent 
>if they have the potential for executing in parallel."

Can you write a test program that can tell the difference?

- Bob




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

* Re: Tasks in Gnat3.05 for Dos?
  1996-07-17  0:00     ` Robert Dewar
  1996-07-21  0:00       ` Spasmo
@ 1996-07-23  0:00       ` Jon S Anthony
  1 sibling, 0 replies; 10+ messages in thread
From: Jon S Anthony @ 1996-07-23  0:00 UTC (permalink / raw)



In article <Duz0vv.L67@world.std.com> bobduff@world.std.com (Robert A Duff) writes:

> John Harbaugh  <johnh@bunsen.ds.boeing.com> wrote:

> > In their excellent book "Concurrency In Ada" Burns and Welling make
> > a useful distinction between parallelism and concurrency:
> >
> > "Two processes are said to be executing in parallel if at any
> > instant they are both executing...  By comparison, two processes are
> > said to be concurrent if they have the potential for executing in
> > parallel." 
> 
> Can you write a test program that can tell the difference?

This is an interesting distinction, but as Bob points out it is
problematic.  The problem concerns the term "potential".  We can
certainly infer that parallel processes are concurrent processes, but
it is not obvious what the other concurrent processes are.

I'm in the process of getting this book, so I don't know at this point
whether the authors spell out what constitutes "potential" in this
context.

/Jon
-- 
Jon Anthony
Organon Motives, Inc.
1 Williston Road, Suite 4
Belmont, MA 02178

617.484.3383
jsa@organon.com





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

* Re: Tasks in Gnat3.05 for Dos?
  1996-07-23  0:00           ` Robert A Duff
@ 1996-07-24  0:00             ` John Harbaugh
  0 siblings, 0 replies; 10+ messages in thread
From: John Harbaugh @ 1996-07-24  0:00 UTC (permalink / raw)



Robert A Duff wrote:
> 
> In article <31F3E4E7.13E4@bunsen.ds.boeing.com>,
> John Harbaugh  <johnh@bunsen.ds.boeing.com> wrote:
> >In their excellent book "Concurrency In Ada" Burns and Welling make a useful
> >distinction between parallelism and concurrency:
> >
> >"Two processes are said to be executing in parallel if at any instant they
> >are both executing...  By comparison, two processes are said to be concurrent
> >if they have the potential for executing in parallel."
> 
> Can you write a test program that can tell the difference?
> 
> - Bob

The distinction is useful but not rigorous.  I do not claim to speak for the 
authors, but my understanding is that they want the reader to think of 
program structure as independent of hardware architecture.  A correct 
concurrent design will work on one or many processors; a design which assumes 
a multi-processor architecture may not execute correctly on a 
single-processor machine (at least not without some kludge like time 
slicing).  In a recent post, Dr. Feldman related his experience with 
re-hosting a transportations simulation.  The portability was, I suspect, the 
result of understanding the inherent concurrency of the problem.

In other words, concurrency is an attribute of the problem space.  
Parallelism is an attribute of the solution space.

	- John Harbaugh
	The Boeing Company




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

end of thread, other threads:[~1996-07-24  0:00 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-07-16  0:00 Tasks in Gnat3.05 for Dos? Spasmo
1996-07-16  0:00 ` John S. Harbaugh
1996-07-17  0:00   ` Spasmo
1996-07-17  0:00     ` Robert Dewar
1996-07-21  0:00       ` Spasmo
1996-07-21  0:00         ` Michael Feldman
1996-07-22  0:00         ` John Harbaugh
1996-07-23  0:00           ` Robert A Duff
1996-07-24  0:00             ` John Harbaugh
1996-07-23  0:00       ` Jon S Anthony

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