comp.lang.ada
 help / color / mirror / Atom feed
From: "Hibou57 (Yannick Duchêne)" <yannick_duchene@yahoo.fr>
Subject: Re: Start a Windows process and get its text output
Date: Sun, 7 Feb 2010 11:24:41 -0800 (PST)
Date: 2010-02-07T11:24:41-08:00	[thread overview]
Message-ID: <f9bb0878-0c89-4590-bf82-e6597459214a@d27g2000yqn.googlegroups.com> (raw)
In-Reply-To: 22cd779c-b1bb-4501-abfe-7b35c2dd7a7b@b2g2000yqi.googlegroups.com

As it is the subject here : I've just checked at least with GNAT it
work nice to create a task, invok a CreateProcess from this Ada task
and then WaitForSingleObject with delay INFINITE on the process handle
always in the same Ada task : other Ada task are still running
normally (a protected object can then be used to tell any other task
the process has terminated).

I was wondering about the cost of threads on Windows, as GNAT create
Ada task as Windows thread (I suppose its the same for Janus and
others, I hope to be honest). I just found there is a default
allocated stack of 1M bytes, and nothing about the cost of task
creation and task switch in CPU cycles (from a pure point of view,
dropping any page fault and the like). If someone know a good source
about it, it would be nice (this is to weigh up the choice to have an
Ada task per process vs. a single Ada task managing multiple
processes).

The sole words about it in the MS reference says :
> The number of threads a process can create is limited by the
> available virtual memory. By default, every thread has one megabyte
> of stack space. Therefore, you can create at most 2028 threads. If
> you reduce the default stack size, you can create more threads.
> However, your application will have better performance if you create
> one thread per processor and build queues of requests for which the
> application maintains the context information. A thread would
> process all requests in a queue before processing requests in the
> next queue.

While the thread (then Ada task) stack size can be tuned with the
Storage_Size attribute, while formally speaking, as of [ARM 13.1(60)],
this is not strictly the stack size, but rather a size including the
stack size. And this attribute is marked as obsolescent in [ARM J.6],
in favor of the pragma which as the same name.



  reply	other threads:[~2010-02-07 19:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-06 17:39 Start a Windows process and get its text output Gautier write-only
2010-02-06 18:12 ` Hibou57 (Yannick Duchêne)
2010-02-06 18:23 ` Pascal Obry
2010-02-06 19:21   ` Gautier write-only
2010-02-06 19:42 ` Jeffrey R. Carter
2010-02-06 21:01 ` Dmitry A. Kazakov
2010-02-07 17:54 ` Vadim Godunko
2010-02-07 19:24   ` Hibou57 (Yannick Duchêne) [this message]
2010-02-07 19:36     ` Hibou57 (Yannick Duchêne)
2010-02-07 20:35     ` Hibou57 (Yannick Duchêne)
2010-02-07 21:36     ` Dmitry A. Kazakov
replies disabled

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