[Mono-list] Threading and IO problem

Madars Vitolins madars.vitolins at gmail.com
Thu Mar 6 16:42:17 EST 2008


Well I just tried following:


My cpu: Intel(R) Pentium(R) 4 CPU 2.80GHz, with HT

Just run modified example and I see that it shows:
..
 public void Process()
        {
        int x=0;
            while(true)
            {
                if (x % 2>0)
                        x+=1;
                else
                        x+=3;
            }
        }

...

Mem:   1033164k total,  1012292k used,    20872k free,   194076k buffers
Swap:  3906496k total,     2664k used,  3903832k free,   369308k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 9067 root      15   0 17804 5080 3664 S  196  0.5   1:26.65 mono

...
 public void Process()
        {
            string Str;
            while (true)
            {
            using (StreamReader SR = new StreamReader(FileName))
                while ((Str = SR.ReadLine()) != null) ;
            }
        }
...

File size: 3,5kb
Mem:   1033164k total,   175472k used,   857692k free,     1164k buffers
Swap:  3906496k total,   154100k used,  3752396k free,    38736k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 9156 root      15   0 18252 5788 3764 S  164  0.6   3:24.62 mono

With file size ~ 38mb

Cpu(s): 94.4%us,  2.7%sy,  0.0%ni,  2.8%id,  0.0%wa,  0.0%hi,  0.2%si,
0.0%st
Mem:   1033164k total,   226360k used,   806804k free,     1640k buffers
Swap:  3906496k total,   154100k used,  3752396k free,    81516k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 9193 root      15   0 18928 6388 3788 S  191  0.6   3:47.86 mono

So it seems some kind of bottleneck when "new StreamReader(FileName)" get
produced
with file opening etc..
But my system shows CPU load like for real processors.

Regards,
Madars


On Thu, Mar 6, 2008 at 11:09 PM, Will Murnane <will.murnane at gmail.com>
wrote:

> On Thu, Mar 6, 2008 at 3:46 PM, Yanko Hernández Álvarez
> <yhdezalvarez at gmail.com> wrote:
> >  Seeing the stats, it seems I overestimated the CPU use.  It's even
> >  lower than I thought (60..70% instead of 70..80%)
> ...
> >  It is a Dell PowerEdge 2900 (2 xeon 5050, dual core, each core
> hyperthreaded)
> That's only 4 real execution units.  You're getting the extra smidgeon
> of performance that HT gives in the best case, but there just aren't 8
> cores there.  Getting real quad core chips (Harpertown) will likely
> mean you can get to full 8 core usage.
>
> If you turn off HT in the BIOS (if such a thing is possible on a Dell)
> you would probably see 100% utilization.  But you're getting what I'd
> be inclined to call 120% right now, so unless you want to confirm that
> this is indeed the case, I'd just leave it alone.
>
> Will
> _______________________________________________
> 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/20080306/120d2342/attachment.html 


More information about the Mono-list mailing list