Busy waiting fix

25 views
Skip to first unread message

Brendan Moloney

unread,
Apr 26, 2012, 4:11:44 PM4/26/12
to cmtk-...@googlegroups.com
Hello,

We have noticed that connectomemapper uses two cores while processing.  I have found that this is due to busy waiting in the logme.runCmd function. Attached is a simple two line patch for logme.py that will fix this issue. It just sleeps for one second during each iteration of the busy waiting loop.

Thanks,
Brendan
logme.patch

Stephan Gerhard

unread,
Apr 27, 2012, 2:52:17 AM4/27/12
to cmtk-...@googlegroups.com
Alessandra,

Can you apply this patch?

Stephan

Qingyang Li

unread,
May 2, 2012, 3:16:03 PM5/2/12
to cmtk-...@googlegroups.com
This  will be very useful!

Yang
------
Qingyang Li

Balance and focus.

Alessandra Griffa

unread,
May 4, 2012, 12:06:11 PM5/4/12
to cmtk-...@googlegroups.com
Hi! 
I'm not at my workplace at the moment, but I've already applied the patch. I will commit next week.
Alessandra

Brendan

unread,
Jul 11, 2012, 8:49:28 PM7/11/12
to cmtk-...@googlegroups.com
I am sorry to say that there is a slight issue with my patch which was causing two cores to still be used for much of the processing.

Basically the sleep command should come before the try/except block instead of after.

I see that this is fixed (and the sleep interval is made configurable) in this commit anyway: https://github.com/LTS5/cmp/commit/22de8b774126f5b5b8e519e8748fdb79aa578a8d
Reply all
Reply to author
Forward
0 new messages