Recursion problem too

Jul 27, 2011 at 7:01 PM

Hello,

The code below doesn't wait too:

System.Diagnostics.Debug.WriteLine("begin waitall");

            PortableTPL.Task task0 = PortableTPL.Task.Factory.StartNew(() =>
            {
                //PortableTPL.Task task1 = PortableTPL.Task.Factory.StartNew(() =>
                //{
                //    System.Diagnostics.Debug.WriteLine("task1");
                //    });

                //PortableTPL.Task task2 = PortableTPL.Task.Factory.StartNew(() =>
                //{
                //    System.Diagnostics.Debug.WriteLine("task2");
                //    });

                //List<PortableTPL.Task> tasks = new List<PortableTPL.Task>() { task1, task2 };
                //PortableTPL.Task.WaitAll(tasks.ToArray());

                PortableTPL.Parallel.For(0, 10, (i) =>
                    {
                      System.Diagnostics.Debug.WriteLine(  Math.Pow(i, i));
                    }
                );
            });
            System.Diagnostics.Debug.WriteLine("waitall"); 
On the main thread, no problem. But if I use task0 thread, Parallel.For (and maybe Parallel.Foreach ) isn't synchronized with task0.
Thanks in advance for your help.
Coordinator
Jul 27, 2011 at 7:14 PM

Hi

I will take a look at your problem to determine what’s happen

From: alphapager [email removed]
Sent: mercredi 27 juillet 2011 21:01
To: david.catuhe@live.fr
Subject: Recursion problem too [portabletpl:266771]

From: alphapager

Hello,

The code below doesn't wait too:

System.Diagnostics.Debug.WriteLine("begin waitall");
 
            PortableTPL.Task task0 = PortableTPL.Task.Factory.StartNew(() =>
            {
                //PortableTPL.Task task1 = PortableTPL.Task.Factory.StartNew(() =>
                //{
                //    System.Diagnostics.Debug.WriteLine("task1");
                //    });
 
                //PortableTPL.Task task2 = PortableTPL.Task.Factory.StartNew(() =>
                //{
                //    System.Diagnostics.Debug.WriteLine("task2");
                //    });
 
                //List<PortableTPL.Task> tasks = new List<PortableTPL.Task>() { task1, task2 };
                //PortableTPL.Task.WaitAll(tasks.ToArray());
 
                PortableTPL.Parallel.For(0, 10, (i) =>
                    {
                      System.Diagnostics.Debug.WriteLine(  Math.Pow(i, i));
                    }
                );
            });
            System.Diagnostics.Debug.WriteLine("waitall"); 
On the main thread, no problem. But if I use task0 thread, Parallel.For (and maybe Parallel.Foreach ) isn't synchronized with task0.
Thanks in advance for your help.
Jul 28, 2011 at 4:58 PM
Edited Jul 28, 2011 at 4:58 PM

Ok, I know you stop to update PortableTPL, Deltakosh because of Portable Library limitations, but were you able to reproduce this bug ?

I ask the question because I use Mango 7.1 beta (sorry I forgot to write that) and it could be a bug only due to the beta.

Thanks anyway for your great tool.

Coordinator
Jul 28, 2011 at 5:15 PM

Hi I’m really sorry to stop PortableTPL

I will restart it as soon as the portable library will re-include threads

But by the way I was not able to reproduce your bug L

From: alphapager [email removed]
Sent: jeudi 28 juillet 2011 18:58
To: david.catuhe@live.fr
Subject: Re: Recursion problem too [portabletpl:266771]

From: alphapager

Ok, I know you stop to update PortableTPL, Deltakosh because of Portable Library limitations, but were you able to reproduce this bug ?

I ask the question because I use Mango 7.1 beta (sorry I forgot to write that) and it could bug only due to the beta.

Thanks anyway for your great tool.