[Mono-list] PFX doesn't work in Mono 2.6

Yury Serdyuk Yury at serdyuk.botik.ru
Thu Dec 17 07:04:59 EST 2009


Hi !

I have tried a simple program

$ cat Test_PFX_For.cs
using System;
using System.Threading;

public class Test_PFX_For {

 public static void Main ( String[] args ) {

  int num_threads = 1;

  Parallel.For ( 0, num_threads, i =>
  {
   long k = 0;
   while ( true ){
    k++;
    k--;
   }
  });
 }
}

under Mono 2.6 and Linux

Linux 2.6.18-128.el5 #1 SMP Wed Jan 21 10:41:14 EST 2009 x86_64 x86_64 
x86_64 GNU/Linux

But the program doesn't work properly -
it loads all processors:

> bash-3.2$ mono -V
> Mono JIT compiler version 2.6 (tarball Thu Dec 17 11:17:37 MSK 2009)
> Copyright (C) 2002-2008 Novell, Inc and Contributors. www.mono-project.com
>         TLS:           __thread
>         GC:            Included Boehm (with typed GC and Parallel Mark)
>         SIGSEGV:       altstack
>         Notifications: epoll
>         Architecture:  amd64
>         Disabled:      none
> bash-3.2$ dmcs Test_PFX_For.cs
> bash-3.2$ mono ./Test_PFX_For.exe

> -bash-3.2$ top
> top - 14:58:28 up 19 days, 19:43,  2 users,  load average: 6.71, 4.27, 
> 4.10
> Tasks: 279 total,   2 running, 277 sleeping,   0 stopped,   0 zombie
> Cpu0  :100.0%us,  0.0%sy,  0.0%ni,  0.0%id,  0.0%wa,  0.0%hi,  
> 0.0%si,  0.0%st
> Cpu1  :100.0%us,  0.0%sy,  0.0%ni,  0.0%id,  0.0%wa,  0.0%hi,  
> 0.0%si,  0.0%st
> Cpu2  :100.0%us,  0.0%sy,  0.0%ni,  0.0%id,  0.0%wa,  0.0%hi,  
> 0.0%si,  0.0%st
> Cpu3  :100.0%us,  0.0%sy,  0.0%ni,  0.0%id,  0.0%wa,  0.0%hi,  
> 0.0%si,  0.0%st
> Cpu4  :100.0%us,  0.0%sy,  0.0%ni,  0.0%id,  0.0%wa,  0.0%hi,  
> 0.0%si,  0.0%st
> Cpu5  :100.0%us,  0.0%sy,  0.0%ni,  0.0%id,  0.0%wa,  0.0%hi,  
> 0.0%si,  0.0%st
> Cpu6  :100.0%us,  0.0%sy,  0.0%ni,  0.0%id,  0.0%wa,  0.0%hi,  
> 0.0%si,  0.0%st
> Cpu7  :100.0%us,  0.0%sy,  0.0%ni,  0.0%id,  0.0%wa,  0.0%hi,  
> 0.0%si,  0.0%st
> Cpu8  :100.0%us,  0.0%sy,  0.0%ni,  0.0%id,  0.0%wa,  0.0%hi,  
> 0.0%si,  0.0%st
> Cpu9  :100.0%us,  0.0%sy,  0.0%ni,  0.0%id,  0.0%wa,  0.0%hi,  
> 0.0%si,  0.0%st
> Cpu10 :100.0%us,  0.0%sy,  0.0%ni,  0.0%id,  0.0%wa,  0.0%hi,  
> 0.0%si,  0.0%st
> Cpu11 :100.0%us,  0.0%sy,  0.0%ni,  0.0%id,  0.0%wa,  0.0%hi,  
> 0.0%si,  0.0%st
> Cpu12 :100.0%us,  0.0%sy,  0.0%ni,  0.0%id,  0.0%wa,  0.0%hi,  
> 0.0%si,  0.0%st
> Cpu13 :100.0%us,  0.0%sy,  0.0%ni,  0.0%id,  0.0%wa,  0.0%hi,  
> 0.0%si,  0.0%st
> Cpu14 :100.0%us,  0.0%sy,  0.0%ni,  0.0%id,  0.0%wa,  0.0%hi,  
> 0.0%si,  0.0%st
> Cpu15 :100.0%us,  0.0%sy,  0.0%ni,  0.0%id,  0.0%wa,  0.0%hi,  
> 0.0%si,  0.0%st
> Mem:  49449700k total,   869124k used, 48580576k free,   166836k buffers
> Swap:  2096472k total,        0k used,  2096472k free,   502932k cached
>
>   PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
> 11201 xxx   25   0 7134m 7532 3636 R 1599.7  0.0   7:18.81 mono

Any comments or suggestions ?

Yury.



More information about the Mono-list mailing list