comp.lang.ada
 help / color / mirror / Atom feed
From: merdi92@tor.hv.se (Morgan Ericsson)
Subject: Q: Dynamic tasks spawning error?
Date: 1996/04/30
Date: 1996-04-30T00:00:00+00:00	[thread overview]
Message-ID: <4m4v27$8a5@fizban.solace.mh.se> (raw)


We have a problem with a program that involves dynamic spawing of tasks. We
think this code should be legal. GNAT (uses gcc 2.7.2) manages to compile
and link but as soon as "we" use a dynamically spawned task nothing
happens. No busy waiting, no exceptions, no nothing! 

(We run gnat on Solaris 2.5 machines)

What we want to know is wether this is correct ada or a compiler problem. We
know that tasks have been a problem in earlier versions of gnat.  

--8<-- Task def.

type List;
 
type pointer is access List;
 
type List is record
        next : pointer;
        prev : pointer;
        salong : Taskp;
        number : Integer;
end record;

first, last : pointer;

task type Visning is
        entry tdbokning( Antalp, Onskadp: in Integer;
                        OK: out Boolean; Platsarray: out String);
        entry tbokning( telnr: in String;
                        Antalp, Onskadp: in Integer;
                        OK: out Boolean; Platsarray: out String);
        entry tavboka(  telnr: in String;
                        Antalp, Onskadp: in Integer;
                        OK: out Boolean; Platsarray: out String);
        entry thamta(   telnr: in String;
                        Antalp, Onskadp: in Integer;
                        OK: out Boolean; Platsarray: out String);
end Visning;
 
type Taskp is access Visning;

tmpnode := new List;

if( first = NULL ) then
	tmpnode.number  := 1;
	tmpnode.salong  := new Visning; -- Is this correct?
	tmpnode.next    := NULL;
	tmpnode.prev    := NULL;
	first          := tmpnode;
	last           := tmpnode;
else
	tmpnode.number := last.number+1;
	tmpnode.salong := new Visning; -- Is this correct?
	tmpnode.next   := NULL;
	tmpnode.prev   := last;
	last.next     := tmpnode;
	last          := tmpnode;
end if;

--8<-- Main program

p : pointer;

-- p points to a list of tasks

p.salong.tbokning(telnr, Antalp, Onskadp, OK, Platsarray);

-- This is where it stops...

--8<--
 
--

     Morgan Ericsson, CS student at Vaxjo Uni (merdi92@tufvan.hv.se)
----------------------------------------------------------------------------
                   I'm not a psycho! I'm Batman!
----------------------------------------------------------------------------
          Check out my WWW page! http://tufvan.hv.se/~merdi92!





             reply	other threads:[~1996-04-30  0:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-04-30  0:00 Morgan Ericsson [this message]
1996-04-30  0:00 ` Q: Dynamic tasks spawning error? Theodore E. Dennison
replies disabled

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