comp.lang.ada
 help / color / mirror / Atom feed
* one task missing during the execution
@ 2014-10-16  3:11 compguy45
  2014-10-16 14:33 ` Adam Beneschan
  2014-10-16 16:59 ` Jacob Sparre Andersen
  0 siblings, 2 replies; 10+ messages in thread
From: compguy45 @ 2014-10-16  3:11 UTC (permalink / raw)


I have 6 tasks......There properly wait at the first entry and print out their ids....then they all accounted for inside doSomething but right before doSomethingElse id 123 just disappears...i have filled my code with output statements and during the execution its showing on screen that its there but right begotr doSomethingElse its gone....Should it not wait like all the others at the second entry?? Can someone suggest how to debug this and find whats going on.....Output to my screen is below..


        123
        132
        213
        231
        321
        312
Inside doSomething by id......... 312
 
Inside doSomething by id......... 132
  
Inside doSomething by id......... 231
  
Inside doSomething by id......... 213
  
Right before doSomethingElse  312
Inside doSomething by id......... 123
  
Right before doSomethingElse 132
Inside doSomething by id......... 321
   
Right before doSomethingElse 213
Right before doSomethingElse 321
Right before doSomethingElse 231

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

* Re: one task missing during the execution
  2014-10-16  3:11 one task missing during the execution compguy45
@ 2014-10-16 14:33 ` Adam Beneschan
  2014-10-16 15:31   ` compguy45
  2014-10-16 16:59 ` Jacob Sparre Andersen
  1 sibling, 1 reply; 10+ messages in thread
From: Adam Beneschan @ 2014-10-16 14:33 UTC (permalink / raw)


On Wednesday, October 15, 2014 8:11:16 PM UTC-7, comp...@gmail.com wrote:
> I have 6 tasks......There properly wait at the first entry and print out their ids....then they all accounted for inside doSomething but right before doSomethingElse id 123 just disappears...i have filled my code with output statements and during the execution its showing on screen that its there but right begotr doSomethingElse its gone....Should it not wait like all the others at the second entry?? Can someone suggest how to debug this and find whats going on.....Output to my screen is below..

What, exactly, were you expecting us to do?  Figure out what your entire program looks like just by seeing the output, so that we could help you debug it?  Sorry, but I don't think anyone on this group has that kind of mind-reading ability.

                                  -- Adam


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

* Re: one task missing during the execution
  2014-10-16 14:33 ` Adam Beneschan
@ 2014-10-16 15:31   ` compguy45
  2014-10-16 16:08     ` Björn Lundin
  2014-10-16 17:48     ` Chris Moore
  0 siblings, 2 replies; 10+ messages in thread
From: compguy45 @ 2014-10-16 15:31 UTC (permalink / raw)


i didn't expect someone to debug the code but i figured just by looking at output since all tasks have same body someone with more experience can suggest what to look for...

i am so sorry about that

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

* Re: one task missing during the execution
  2014-10-16 15:31   ` compguy45
@ 2014-10-16 16:08     ` Björn Lundin
  2014-10-16 22:16       ` Björn Lundin
  2014-10-16 17:48     ` Chris Moore
  1 sibling, 1 reply; 10+ messages in thread
From: Björn Lundin @ 2014-10-16 16:08 UTC (permalink / raw)


On 2014-10-16 17:31, compguy45@gmail.com wrote:
> i didn't expect someone to debug the code but i figured just by looking at output since all tasks have same body someone with more experience can suggest what to look for...
> 
> i am so sorry about that
> 

It would be _so_ much easier to actually _have_ a body to look at.
Just as Adam says: we are not mind-readers...

Do be sorry - post the task body/program instead

--
Björn

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

* Re: one task missing during the execution
  2014-10-16  3:11 one task missing during the execution compguy45
  2014-10-16 14:33 ` Adam Beneschan
@ 2014-10-16 16:59 ` Jacob Sparre Andersen
  2014-10-16 17:22   ` compguy45
  1 sibling, 1 reply; 10+ messages in thread
From: Jacob Sparre Andersen @ 2014-10-16 16:59 UTC (permalink / raw)


compguy45@gmail.com writes:

> I have 6 tasks......There properly wait at the first entry and print
> out their ids....then they all accounted for inside doSomething but
> right before doSomethingElse id 123 just disappears...

Have you included an exception handler at the end of each of your tasks?
All tasks (but the main task) terminate silently in case of an
exception, so it can be useful to have a final exception handler in any
task for registering that it has been terminated by an exception.

Greetings,

Jacob
-- 
Photos from the Faroe Islands:
       http://billeder.sparre-andersen.dk/The_Faroe_Islands/

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

* Re: one task missing during the execution
  2014-10-16 16:59 ` Jacob Sparre Andersen
@ 2014-10-16 17:22   ` compguy45
  0 siblings, 0 replies; 10+ messages in thread
From: compguy45 @ 2014-10-16 17:22 UTC (permalink / raw)


ok i will definitely add piece of code to handle exception to see if that's whats actually happening....

thank you

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

* Re: one task missing during the execution
  2014-10-16 15:31   ` compguy45
  2014-10-16 16:08     ` Björn Lundin
@ 2014-10-16 17:48     ` Chris Moore
  2014-10-16 21:25       ` compguy45
  1 sibling, 1 reply; 10+ messages in thread
From: Chris Moore @ 2014-10-16 17:48 UTC (permalink / raw)


On 16/10/2014 16:31, compguy45@gmail.com wrote:
> i didn't expect someone to debug the code but i figured just by looking at output since all tasks have same body someone with more experience can suggest what to look for...
>
> i am so sorry about that
>

Sieve of Eratosthenes?  I'm also guessing that your missing task is 
raising an exception.


---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com



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

* Re: one task missing during the execution
  2014-10-16 17:48     ` Chris Moore
@ 2014-10-16 21:25       ` compguy45
  2014-10-16 21:55         ` Dmitry A. Kazakov
  0 siblings, 1 reply; 10+ messages in thread
From: compguy45 @ 2014-10-16 21:25 UTC (permalink / raw)


I added...

with Ada.Exceptions;  use Ada.Exceptions;
with Ada.Text_IO;     use Ada.Text_IO;

  exception
 when tasking_error =>
            Put_Line ("Something is wrong here" & Exception_Information (Error));
 when others =>
               put("some other error occurred");

I get error xpected private type "Ada.Exceptions.Exception_Occurrence"
 found type "Ada.Strings.Truncation"
" compilation error

when i just say when tasking_error => "Some error" get compiles fine and prints "some error" which tells me there is tasking error....

is there way to get more information about error?

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

* Re: one task missing during the execution
  2014-10-16 21:25       ` compguy45
@ 2014-10-16 21:55         ` Dmitry A. Kazakov
  0 siblings, 0 replies; 10+ messages in thread
From: Dmitry A. Kazakov @ 2014-10-16 21:55 UTC (permalink / raw)


On Thu, 16 Oct 2014 14:25:52 -0700 (PDT), compguy45@gmail.com wrote:

>   exception
>  when tasking_error =>
>             Put_Line ("Something is wrong here" & Exception_Information (Error));

when Error : tasking_error =>
   Put_Line ("Something is wrong here" & Exception_Information (Error));

and

with GNAT.Exception_Traces;
...
begin
   GNAT.Exception_Traces.Trace_On (GNAT.Exception_Traces.Every_Raise);

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


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

* Re: one task missing during the execution
  2014-10-16 16:08     ` Björn Lundin
@ 2014-10-16 22:16       ` Björn Lundin
  0 siblings, 0 replies; 10+ messages in thread
From: Björn Lundin @ 2014-10-16 22:16 UTC (permalink / raw)


On 2014-10-16 18:08, Björn Lundin wrote:
> Do be sorry - post the task body/program instead

 Don't be sorry - post the task body/program instead
 ^^^^^

--
Björn


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

end of thread, other threads:[~2014-10-16 22:16 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-16  3:11 one task missing during the execution compguy45
2014-10-16 14:33 ` Adam Beneschan
2014-10-16 15:31   ` compguy45
2014-10-16 16:08     ` Björn Lundin
2014-10-16 22:16       ` Björn Lundin
2014-10-16 17:48     ` Chris Moore
2014-10-16 21:25       ` compguy45
2014-10-16 21:55         ` Dmitry A. Kazakov
2014-10-16 16:59 ` Jacob Sparre Andersen
2014-10-16 17:22   ` compguy45

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