[Mono-dev] Busy loop in mono

Jonathan Gagnon jonathan.gagnon at croesus.com
Thu Feb 27 13:55:06 UTC 2014


Hi Zoltan,

My test was done with mono 3.2.5 on a i686 CentOS.

I'll try with the latest version and let you know how it goes.

*Jonathan Gagnon*
Architecte d'application / Application Architect
600, boulevard Armand-Frappier, bureau 200
Laval (Québec) H7V 4B4
Canada
T : 450-662-6101 poste 234
<http://www.croesus.com>
 <http://www.facebook.com/pages/Croesus-Finansoft/345020305606240><http://www.linkedin.com/company/croesus-finansoft?trk=hb_tab_compy_id_26141><https://twitter.com/CroesusFin>



On Mon, Feb 24, 2014 at 6:45 PM, Zoltan Varga <vargaz at gmail.com> wrote:

> Hi,
>
>   I cannot reproduce this with mono master on a debian amd64 system.
>
>                Zoltan
>
>
>  On Fri, Jan 31, 2014 at 4:03 PM, Jonathan Gagnon <
> jonathan.gagnon at croesus.com> wrote:
>
>>  It seems to be related to thread pool threads. I wrote a simple program
>> that reproduces the problem:
>>
>> using System.Threading;
>> using System.Threading.Tasks;
>>
>> namespace MultiThreadApp
>> {
>> class Program
>> {
>> static ManualResetEvent evnt = new ManualResetEvent(false);
>>
>> static void Main(string[] args)
>> {
>> for (int i = 0; i < 50; ++i)
>>  {
>> Task task = new Task(DoNothing);
>> task.Start();
>>  }
>>
>> evnt.WaitOne();
>> }
>>
>>  static void DoNothing()
>> {
>> Thread.Sleep(1000);
>>  }
>> }
>> }
>>
>>
>>
>>
>>
>>
>> On Fri, Jan 31, 2014 at 2:31 PM, Jonathan Gagnon <
>> jonathan.gagnon at croesus.com> wrote:
>>
>>> It seems like this bug
>>> https://bugzilla.novell.com/show_bug.cgi?id=379602 in mono 3.2.5.
>>>
>>> I was fixed in mono 2.4 but it seems to have reappeared since then
>>> because my process is using CPU at doing nothing and I noticed it gets
>>> worse if I add threads (even if they do nothing). When I use strace on a
>>> process running with mono 3.2.5, I get a similar output :
>>>
>>> futex(0x9ce6520, FUTEX_WAIT, 81061, {0, 999009600}) = -1 ETIMEDOUT
>>> (Connection timed out)
>>> time(NULL)                              = 1391196463
>>> futex(0x9ce6504, FUTEX_WAKE, 1)         = 0
>>> gettimeofday({1391196463, 363628}, NULL) = 0
>>> gettimeofday({1391196463, 363707}, NULL) = 0
>>> time(NULL)                              = 1391196463
>>> gettimeofday({1391196463, 363848}, NULL) = 0
>>> time(NULL)                              = 1391196463
>>> time(NULL)                              = 1391196463
>>> clock_gettime(CLOCK_REALTIME, {1391196463, 364038031}) = 0
>>> futex(0x9ce6520, FUTEX_WAIT, 81063, {0, 998961969}) = -1 ETIMEDOUT
>>> (Connection timed out)
>>> time(NULL)                              = 1391196464
>>> futex(0x9ce6504, FUTEX_WAKE, 1)         = 0
>>> gettimeofday({1391196464, 363500}, NULL) = 0
>>> gettimeofday({1391196464, 363597}, NULL) = 0
>>> time(NULL)                              = 1391196464
>>> gettimeofday({1391196464, 363713}, NULL) = 0
>>> time(NULL)                              = 1391196464
>>> time(NULL)                              = 1391196464
>>> clock_gettime(CLOCK_REALTIME, {1391196464, 363903927}) = 0
>>>
>>> The same process doesn't use any cpu time when running on .NET.
>>>
>>> Any idea what could cause this problem.  Has anyone else noticed this
>>> problem?
>>>
>>> Jonathan
>>>
>>
>>
>> _______________________________________________
>> Mono-devel-list mailing list
>> Mono-devel-list at lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20140227/d2532cfc/attachment.html>


More information about the Mono-devel-list mailing list