comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Tasking issues
Date: Sun, 12 Aug 2007 20:03:32 +0200
Date: 2007-08-12T20:03:24+02:00	[thread overview]
Message-ID: <eoz7rhdkjpvf.13wdkcfdj1tri$.dlg@40tude.net> (raw)
In-Reply-To: 1186938729.414350.288620@d55g2000hsg.googlegroups.com

On Sun, 12 Aug 2007 10:12:09 -0700, shaunpatterson@gmail.com wrote:

> I just wanted the two threads to run quitely in the
> background.
>
>  However, one thread is reading from sockets...
> and that thread is preventing the other task from running.

Reading from socket does not block anything, provided that the tasks are
mapped to native threads.
 
> I'd have to check, but I was SURE I set the GNAT Sockets to
> non-blocking... which (I assume) would allow the other thread
> to run.

You should check that tasks are mapped to OS threads. AFAIK, this is the
default when you are using GNAT. If not, then all tasks are scheduled by
Ada RTL from one system thread and consequently I/O would block all of
them. See

http://gcc.gnu.org/onlinedocs/gcc-3.4.6/gnat_ugn_unw/Choosing-between-Native-and-FSU-Threads-Libraries.html

With native threads you can safely do blocking socket I/O without any
problems. Otherwise, you should use only asynchronous I/O.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



  reply	other threads:[~2007-08-12 18:03 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-11 17:03 Tasking issues shaunpatterson
2007-08-11 18:42 ` Dmitry A. Kazakov
2007-08-12 11:06   ` Simon Wright
2007-08-12 12:05     ` Dmitry A. Kazakov
2007-08-12 17:12       ` shaunpatterson
2007-08-12 18:03         ` Dmitry A. Kazakov [this message]
2007-08-12 22:10         ` Jeffrey R. Carter
2007-08-13 19:54         ` Simon Wright
2007-08-13 22:30           ` shaunpatterson
2007-08-14  7:10             ` Tasking issues => Book List anon
     [not found]     ` <13bulskfjvogv8e@corp.supernews.com>
2007-08-12 20:20       ` Tasking issues Simon Wright
2007-08-11 18:51 ` jimmaureenrogers
2007-08-11 19:08 ` Jeffrey R. Carter
2007-08-11 22:31 ` Steve
2007-08-12  9:00 ` anon
2007-08-12  9:43   ` Dmitry A. Kazakov
2007-08-12 21:39     ` anon
2007-08-12 22:15       ` Jeffrey R. Carter
2007-08-13  9:13         ` anon
2007-08-13 19:37           ` Simon Wright
2007-08-13 20:17             ` Markus E.L. 2
2007-08-14  0:40           ` Jeffrey R. Carter
2007-08-13  9:22       ` Dmitry A. Kazakov
2007-08-13 12:41         ` Larry Kilgallen
2007-08-13 13:22           ` Dmitry A. Kazakov
2007-08-12 21:03   ` Maciej Sobczak
2007-08-12 22:07   ` Jeffrey R. Carter
replies disabled

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