[Mono-list] corflags.exe

Steve Lessard s_lessard at yahoo.com
Thu Jul 8 12:03:31 EDT 2010


Is there a Mono equivalent of Microsoft's CorFlags.exe tool?




________________________________
From: Yury Serdyuk <Yury at serdyuk.botik.ru>
To: Jérémie Laval <jeremie.laval at gmail.com>
Cc: mono-list at lists.ximian.com
Sent: Wed, July 7, 2010 5:59:32 AM
Subject: Re: [Mono-list] PFX still doesn't work correctly (in Mono 2.6.4)

One more remark -

though in the program

> using System;
> using System.Threading;
>
> public class Test_PFX_For {
>
>  public static void Main ( String[] args ) {
>
>   int num_threads = Convert.ToInt32 ( args [ 0 ] );
>
>   ParallelOptions po = new ParallelOptions
>   {
>    MaxDegreeOfParallelism = num_threads
>   };
>
>   Parallel.For ( 0, 100, po, i =>
>   {
>    long k = 0;
>    while ( true ){
>     k++;
>     k--;
>    }
>   });
>  }
> }

ParallelOptions mode works good, but it seems in the Parallel.Invoke 
construction
it doesn't act. Is it true ?

The test code for Parallel.Invoke is:

> using System;
> using System.Threading;
> using System.Diagnostics;
> using System.IO;
>
> namespace QuickSort
> {
>     class Program
>     {
>         static void q_sort(int[] array, int left, int right, bool 
> forceSequential)
>         {
>             int current, last;
>             if (left >= right) return;
>
>             swap(array, left, (left + right) / 2);
>
>             last = left;
>
>             for (current = left + 1; current <= right; ++current)
>             {
>                 if (array[current] < array[left])
>                 {
>                     ++last;
>                     swap(array, last, current);
>                 }
>             }
>             swap(array, left, last);
>
>             if (forceSequential || (last - left) < 4096)
>             {
>                 q_sort(array, left, last - 1, forceSequential);
>                 q_sort(array, last + 1, right, forceSequential);
>             }
>             else
>             {
>                 Parallel.Invoke(
>                     po,
>                     delegate { q_sort(array, left, last - 1, 
> forceSequential); },
>                     delegate { q_sort(array, last + 1, right, 
> forceSequential); });
>             }
>         }
>
>         static void swap(int[] array, int i, int j)
>         {
>             int temp;
>             temp = array[i];
>             array[i] = array[j];
>             array[j] = temp;
>         }
>
>         static ParallelOptions po;
>
>
>         static void Main(string[] args)
>         {
>                 int P = System.Convert.ToInt32 ( args [ 0 ] );
>
>                 FileStream   fs = new FileStream ( args [ 1 ], 
> FileMode.Open, FileAccess.Read );
>                 StreamReader sr = new StreamReader ( fs );
>
>                 int   N = System.Convert.ToInt32 ( sr.ReadLine() );
>                 Console.WriteLine ( "N = " + N );
>
>                 int[]  array = new int [ N ];
>
>                 DateTime dt1 = DateTime.Now;
>                 for ( int i = 0; i < N; i++ )
>                  array [ i ] = System.Convert.ToInt32 ( sr.ReadLine() );
>                 DateTime dt2 = DateTime.Now;
>                 Console.WriteLine ( "read_data: " + 
> (dt2-dt1).TotalSeconds + " sec." );
>
>                 sr.Close();
>                 fs.Close();
>
>                 po = new ParallelOptions
>                 {
>                  MaxDegreeOfParallelism = P
>                 };
>
>
>                 //
>                 // Sequential
>                 //
>
>                 //dt1 = DateTime.Now;
>                 //q_sort(array, 0, array.Length - 1, true);
>                 //dt2 = DateTime.Now;
>
>                 //Console.WriteLine("Sequential: {0} sec.", 
> (dt2-dt1).TotalSeconds );
>
>                 //
>                 // Parallel
>                 //
>
>                 dt1 = DateTime.Now;
>                 q_sort(array, 0, array.Length - 1, false);
>                 dt2 = DateTime.Now;
>
>                 Console.WriteLine("Parallel: {0} sec.", 
> (dt2-dt1).TotalSeconds);
>
>         }
>
>     }
>
> }

Thanks.

Yury.

_______________________________________________
Mono-list maillist  -  Mono-list at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20100708/fedde0ad/attachment.html 


More information about the Mono-list mailing list