comp.lang.ada
 help / color / mirror / Atom feed
* Q: Dynamic tasks spawning error?
@ 1996-04-30  0:00 Morgan Ericsson
  1996-04-30  0:00 ` Theodore E. Dennison
  0 siblings, 1 reply; 2+ messages in thread
From: Morgan Ericsson @ 1996-04-30  0:00 UTC (permalink / 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!





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

* Re: Q: Dynamic tasks spawning error?
  1996-04-30  0:00 Q: Dynamic tasks spawning error? Morgan Ericsson
@ 1996-04-30  0:00 ` Theodore E. Dennison
  0 siblings, 0 replies; 2+ messages in thread
From: Theodore E. Dennison @ 1996-04-30  0:00 UTC (permalink / raw)



Morgan Ericsson wrote:
> 
> 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!
> 

Its tough to say without seeing the body of your task. However, when
I put my swammie hat on, close my eyes tight, place my hands the
monitor, and concentrate, the term "task deadlock" keeps popping into
my head.

If "the amazing Tedkin" is right, that would mean your task (type) is
waiting on another rendezvous which never arrives, while your main
task is attempting to rendezvous with it.


-- 
T.E.D.          
                |  Work - mailto:dennison@escmail.orl.mmc.com  |
                |  Home - mailto:dennison@iag.net              |
                |  URL  - http://www.iag.net/~dennison         |




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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-04-30  0:00 Q: Dynamic tasks spawning error? Morgan Ericsson
1996-04-30  0:00 ` Theodore E. Dennison

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