* [PATCH] utils: Add a cpu_count wrapper function
@ 2014-01-27 14:38 Richard Purdie
2014-01-27 16:44 ` Otavio Salvador
0 siblings, 1 reply; 2+ messages in thread
From: Richard Purdie @ 2014-01-27 14:38 UTC (permalink / raw)
To: openembedded-core
Add a cpu_count wrapper function (useful from annonymous python where
the import would be trickier).
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py
index 82987e8..36f82db 100644
--- a/meta/lib/oe/utils.py
+++ b/meta/lib/oe/utils.py
@@ -150,3 +150,7 @@ def trim_version(version, num_parts=2):
parts = version.split(".")
trimmed = ".".join(parts[:num_parts])
return trimmed
+
+def cpu_count():
+ import multiprocessing
+ return multiprocessing.cpu_count()
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] utils: Add a cpu_count wrapper function
2014-01-27 14:38 [PATCH] utils: Add a cpu_count wrapper function Richard Purdie
@ 2014-01-27 16:44 ` Otavio Salvador
0 siblings, 0 replies; 2+ messages in thread
From: Otavio Salvador @ 2014-01-27 16:44 UTC (permalink / raw)
To: Richard Purdie; +Cc: openembedded-core
On Mon, Jan 27, 2014 at 12:38 PM, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
> Add a cpu_count wrapper function (useful from annonymous python where
> the import would be trickier).
>
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Acked-by: Otavio Salvador <otavio@ossystems.com.br>
--
Otavio Salvador O.S. Systems
http://www.ossystems.com.br http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-01-27 16:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-27 14:38 [PATCH] utils: Add a cpu_count wrapper function Richard Purdie
2014-01-27 16:44 ` Otavio Salvador
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox