comp.lang.ada
 help / color / mirror / Atom feed
* GNAT, Windows NT, Tasks, any experience ?
@ 1997-03-10  0:00 Mats Weber
  1997-03-10  0:00 ` Jonas Nygren
  0 siblings, 1 reply; 10+ messages in thread
From: Mats Weber @ 1997-03-10  0:00 UTC (permalink / raw)



Hi,

we need to port a program with many (order of magnitude: 1000)
dynamically created tasks, doing IO on TCP/IP sockets, from UNIX to
Windows NT.

I don't know much about NT so here are my questions:

Are the GNAT tasks mapped to NT threads ?

If one task does a read on a socket (or the NT equivalent thereof), and
the call blocks because there is no data, will this block the whole
program or just the calling task ?

Do you have any experience running a program with many tasks on NT
(limitations on the number of threads, etc.) ?

Does GNAT support multiprocessors on NT (i.e. can a single Ada program
with tasks run on more than one processor at the same time) ?

What versions of NT does GNAT 3.09 run on ?

Thanks in advance for any answers.




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

* Re: GNAT, Windows NT, Tasks, any experience ?
  1997-03-10  0:00 GNAT, Windows NT, Tasks, any experience ? Mats Weber
@ 1997-03-10  0:00 ` Jonas Nygren
  1997-03-10  0:00   ` Robert Dewar
  1997-03-10  0:00   ` wiljan
  0 siblings, 2 replies; 10+ messages in thread
From: Jonas Nygren @ 1997-03-10  0:00 UTC (permalink / raw)



Mats Weber <Mats.Weber@elca-matrix.ch> wrote in article
<3323E95A.7B50@elca-matrix.ch>...
> Hi,
> 
> we need to port a program with many (order of magnitude: 1000)
> dynamically created tasks, doing IO on TCP/IP sockets, from UNIX to
> Windows NT.
> 
> I don't know much about NT so here are my questions:
> 
> Are the GNAT tasks mapped to NT threads ?

Yes.

> 
> If one task does a read on a socket (or the NT equivalent thereof), and
> the call blocks because there is no data, will this block the whole
> program or just the calling task ?

The calling task only.

> 
> Do you have any experience running a program with many tasks on NT
> (limitations on the number of threads, etc.) ?

In Gnat 3.09 tasks seems to be broken at least when it comes to start 
many tasks simultaneously. The maximum number of tasks I managed to start
was 57 but it varied a bit downwards depending on the test program.

Robert Dewar has also indicated that there are builtin limitations in Gnat
for
starting many simultaneous tasks - but that ACT could provide a special
version
of Gnat that supports a higher number of tasks. For this you would have to
sign
up as a support customer with ACT. (no, he did not specify the actual
limit)

> 
> Does GNAT support multiprocessors on NT (i.e. can a single Ada program
> with tasks run on more than one processor at the same time) ?

Yes, each task/thread is scheduled independently and will use any number
of available processors - it is really an NT threads question.

> 
> What versions of NT does GNAT 3.09 run on ?

I am running Gnat 3.09 on NT 4.0 Server in order to avoid the limitations
on
maximum number of parallel incoming calls (10 I believe) that is built-in
to
NT 4.0 Workstation.

> 
> Thanks in advance for any answers.
> 

Mats, I am right now in the process of developing something very akin to
what
you are about to implement. I started out in Unix environments before I got
my
NT environment setup and that was very straight forward. Going to NT I have
encountered some difficulties.

Gnat 3.09 is based on Cygnus GNU-Win32 which seems to exist in a parallel 
world to the standard MS NT/Win32 environment. If the GNU-Win32 is OK for
your project (license policy and functionality wise) you will not have so
many 
problems, it seems as a rather solid environment. 

Though, if you as I need to interface to MS NT environment you are likely
to 
encounter problems. I have spent some time trying to interface with the 
Winsock-2 DLL but so far I have not managed to build an executable that
will 
run - it fails during the initialization phase.

Perhaps this is something that will be resolved in Gnat 3.10 for NT - 
Robert Dewar maybe would like to comment on that - but I have very much 
given up using Gnat for NT. Probably you would need a support contract - 
I am looking into that now - or perhaps check out ObjectAda from Aonix 
which should have a clean support for a MS environment. I am trying to find
a place where I can test ObjectAda.




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

* Re: GNAT, Windows NT, Tasks, any experience ?
  1997-03-10  0:00 ` Jonas Nygren
@ 1997-03-10  0:00   ` Robert Dewar
  1997-03-12  0:00     ` Kevin Radke
  1997-03-10  0:00   ` wiljan
  1 sibling, 1 reply; 10+ messages in thread
From: Robert Dewar @ 1997-03-10  0:00 UTC (permalink / raw)



Jonas said

<<Robert Dewar has also indicated that there are builtin limitations in Gnat
for
starting many simultaneous tasks - but that ACT could provide a special
version
of Gnat that supports a higher number of tasks. For this you would have to
sign
up as a support customer with ACT. (no, he did not specify the actual
limit)>>


Just to be clear, the ""built-in limitations in GNAT" are not limitations
in GNAT, but limitations in NT. We just map Ada tasks to NT threads, and
reflect any limitations of the underlying layer.

A future version of GNAT (that is what Jonas is referring to in "special
version of GNAT") will provide the option between using NT threads and
using our threads package. The latter will provide  100% validation of annex D, and will also remove limitations
of this type entirely.





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

* Re: GNAT, Windows NT, Tasks, any experience ?
  1997-03-10  0:00 ` Jonas Nygren
  1997-03-10  0:00   ` Robert Dewar
@ 1997-03-10  0:00   ` wiljan
       [not found]     ` <01bc2df7$ab6bec00$262a6282@cln49ae>
  1 sibling, 1 reply; 10+ messages in thread
From: wiljan @ 1997-03-10  0:00 UTC (permalink / raw)





Jonas Nygren <ehsjony@ehs.ericsson.se> wrote in article 
> > Do you have any experience running a program with many tasks on NT
> > (limitations on the number of threads, etc.) ?
> 
> In Gnat 3.09 tasks seems to be broken at least when it comes to start 
> many tasks simultaneously. The maximum number of tasks I managed to start
> was 57 but it varied a bit downwards depending on the test program.
> 
> Robert Dewar has also indicated that there are builtin limitations in
Gnat
> for
> starting many simultaneous tasks - but that ACT could provide a special
> version
> of Gnat that supports a higher number of tasks. For this you would have
to
> sign
> up as a support customer with ACT. (no, he did not specify the actual
> limit)
As Robert already wrote: there is no limitation in the GNAT run time
causing
this. It is however quite simple to change the task limit on NT.
For every task in NT a region will be marked reserved that is used as
stack.
Note this region can never grow. For this reason the default of this
reserved region
is set very large: hex 2000000.
Since all stacks of all threads reside in the same user space of a process
this also imposes a severe limitation on the amount of threads:
The size of the userspace is hex 80000000, this automatically indicates a
maximum
of hex 40 tasks, that decimal 64.

Sinse there was some trouble with GNAT running out of stack this value was
set to this
high limit.
I have just checked the current ld and I can not find an option to change
this
stack reserve size. I am sure that it is, or should be a linker option. It
existed in
gnat304a for NT. With that version I played with it, and I was able to
create more
then 1500 tasks in one process.

> I have spent some time trying to interface with the 
> Winsock-2 DLL but so far I have not managed to build an executable that
> will 
> run - it fails during the initialization phase.
> 
Are you using the right bindings for win32 ???
In my application I am also using directly winsock without any trouble.
It certainly is not a GNAT limitation.

Wiljan




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

* Re: GNAT, Windows NT, Tasks, any experience ?
       [not found]     ` <01bc2df7$ab6bec00$262a6282@cln49ae>
  1997-03-11  0:00       ` Richard Kenner
@ 1997-03-11  0:00       ` Mats Weber
  1 sibling, 0 replies; 10+ messages in thread
From: Mats Weber @ 1997-03-11  0:00 UTC (permalink / raw)



> Theres is an option that you can put into the specs file. Under the *link:
> section
> you can put a -stact command. Your spec file should read like this :
> 
> -----------------------------
> *endfile:
> 
> *link:
> -stack 0x10000,0x10000

Can I still control the task stack size on a per-task basis with 

for <task>'Storage_Size use ...;

or does that linker directive set the same stack size for all tasks ? (I
hope it just changes the reserve size).




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

* Re: GNAT, Windows NT, Tasks, any experience ?
       [not found]         ` <01bc2e51$cc416e00$829d6482@joy.ericsson.se>
@ 1997-03-11  0:00           ` Tom Moran
  1997-03-12  0:00             ` Robert Dewar
  0 siblings, 1 reply; 10+ messages in thread
From: Tom Moran @ 1997-03-11  0:00 UTC (permalink / raw)



> What is the 'infamous "ld bug"'? I have a problem with linking in an
> .LIB file from MS. The linking succeeds but the resulting .EXE have a
  I have a small demo, as well as a real program, that immediately
terminate, with no messages, when I try to execute them.  And someone
else running on NT (I use W95) tried a modifed version of the big
program and it gave a 'this is not a Windows program' message - after
compiling and linking OK.  Could these all be related?




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

* Re: GNAT, Windows NT, Tasks, any experience ?
       [not found]     ` <01bc2df7$ab6bec00$262a6282@cln49ae>
@ 1997-03-11  0:00       ` Richard Kenner
       [not found]         ` <01bc2e51$cc416e00$829d6482@joy.ericsson.se>
  1997-03-12  0:00         ` Fergus Henderson
  1997-03-11  0:00       ` Mats Weber
  1 sibling, 2 replies; 10+ messages in thread
From: Richard Kenner @ 1997-03-11  0:00 UTC (permalink / raw)



In article <01bc2df7$ab6bec00$262a6282@cln49ae> "Pascal Obry" <pascal.obry@der.edfgdf.fr> writes:
>
>*link:
>-stack 0x10000,0x10000

>I can't remember but I'am pretty sure there is a possibility to put this
>option in the ld command line....

Yes, you can pass args to any phase with the -Wp option where "p"
indicates the phase.  So in this case, you'd pass
	-Wl,-stack -Wl,0x10000,0x10000
to the gcc link command.  If you use gnatmake, you'd need to preceed
this by -largs.

Note, however, that specifying such options to the loader seems to 
trigger the infamous "ld bug" more often, at least in my experience.




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

* Re: GNAT, Windows NT, Tasks, any experience ?
  1997-03-11  0:00           ` Tom Moran
@ 1997-03-12  0:00             ` Robert Dewar
  0 siblings, 0 replies; 10+ messages in thread
From: Robert Dewar @ 1997-03-12  0:00 UTC (permalink / raw)



Tom Moran asks

<<  I have a small demo, as well as a real program, that immediately
terminate, with no messages, when I try to execute them.  And someone
else running on NT (I use W95) tried a modifed version of the big
program and it gave a 'this is not a Windows program' message - after
compiling and linking OK.  Could these all be related?>>

It is relatively unlikely that the small demo is an instance of the loader
problem, but it is hard to say, this problem is, from our point of view
so far, somewhat random. It is not that common, certainly not in small
programs (at most one out of thousands of ACVC tests is affected for
example), but it is elusive, and not yet solved. Note that the win32
tools from Cygnus are still in a beta designated state, so it is quite
possible that this is something that may be fixed by the next release
from Cygnus. 





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

* Re: GNAT, Windows NT, Tasks, any experience ?
  1997-03-10  0:00   ` Robert Dewar
@ 1997-03-12  0:00     ` Kevin Radke
  0 siblings, 0 replies; 10+ messages in thread
From: Kevin Radke @ 1997-03-12  0:00 UTC (permalink / raw)



[snip]

>A future version of GNAT (that is what Jonas is referring to in "special
>version of GNAT") will provide the option between using NT threads and
>using our threads package. The latter will provide  100% validation of
>annex D, and will also remove limitations
>of this type entirely.
>

Won't using a "non-nt thread" based package potentially force
the user to NOT use some NT specific features and functions?

I.E. calling thread blocking NT routines would probably block
the whole ada process even though it has multiple tasks, since
the ada scheduler wouldn't have a clue that thread was blocked
in an NT routine.

I could also see potential problems mixing NT threads with
ada tasks using the non-nt thread runtime...

The only experience I have with an NT compiler NOT mapping
tasks and threads 1-1 is with the ada 83 VADS compiler, which
tended to not work very well calling NT routines when using
it's own ada scheduling.  (It also supported mapping tasks
to threads.)

The bigger problem is with microsoft allowing only 7 priorities
to begin with...

BTW, newer versions of the Aonix compiler on NT support
a priority'range of 31, but use a "many to one" mapping.
I.E. 0..3 is mapped to an NT priority of base - 2,
     4..7 is mapped to an NT priority of base - 1, etc.
(The above numbers could be wrong, since I'm at home and
 the actual values are at work...)

Kevin




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

* Re: GNAT, Windows NT, Tasks, any experience ?
  1997-03-11  0:00       ` Richard Kenner
       [not found]         ` <01bc2e51$cc416e00$829d6482@joy.ericsson.se>
@ 1997-03-12  0:00         ` Fergus Henderson
  1 sibling, 0 replies; 10+ messages in thread
From: Fergus Henderson @ 1997-03-12  0:00 UTC (permalink / raw)



kenner@lab.ultra.nyu.edu (Richard Kenner) writes:

>"Pascal Obry" <pascal.obry@der.edfgdf.fr> writes:
>>
>>*link:
>>-stack 0x10000,0x10000
>
>>I can't remember but I'am pretty sure there is a possibility to put this
>>option in the ld command line....
>
>Yes, you can pass args to any phase with the -Wp option where "p"
>indicates the phase.  So in this case, you'd pass
>	-Wl,-stack -Wl,0x10000,0x10000
>to the gcc link command.

The `-Wl' option uses `,' as an argument separator, so this will
pass the three arguments `-stack 0x10000 0x10000' to the linker.
To pass a comma, I think think you need to use `-Xlinker' instead,
i.e. `-Xlinker -stack -Xlinker 0x10000,0x10000'.

--
Fergus Henderson <fjh@cs.mu.oz.au>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger fjh@128.250.37.3         |     -- the last words of T. S. Garp.




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

end of thread, other threads:[~1997-03-12  0:00 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-03-10  0:00 GNAT, Windows NT, Tasks, any experience ? Mats Weber
1997-03-10  0:00 ` Jonas Nygren
1997-03-10  0:00   ` Robert Dewar
1997-03-12  0:00     ` Kevin Radke
1997-03-10  0:00   ` wiljan
     [not found]     ` <01bc2df7$ab6bec00$262a6282@cln49ae>
1997-03-11  0:00       ` Richard Kenner
     [not found]         ` <01bc2e51$cc416e00$829d6482@joy.ericsson.se>
1997-03-11  0:00           ` Tom Moran
1997-03-12  0:00             ` Robert Dewar
1997-03-12  0:00         ` Fergus Henderson
1997-03-11  0:00       ` Mats Weber

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