[gnome-sudoku/multithread_printing] Use libgtop to get user's num of cpus
- From: Parin Porecha <parinporecha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-sudoku/multithread_printing] Use libgtop to get user's num of cpus
- Date: Fri, 15 Aug 2014 10:45:48 +0000 (UTC)
commit a90e437ff81d140e019cd5f01932591500988458
Author: Parin Porecha <parinporecha gmail com>
Date: Fri Aug 15 12:44:38 2014 +0200
Use libgtop to get user's num of cpus
lib/Makefile.am | 1 +
lib/sudoku-generator.vala | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/lib/Makefile.am b/lib/Makefile.am
index f18aca9..1db260c 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -26,6 +26,7 @@ libsudoku_la_VALAFLAGS = \
--pkg gio-2.0 \
--pkg json-glib-1.0 \
--pkg posix \
+ --pkg GTop-2.0 \
--target-glib= TARGET_GLIB@ \
--header=libsudoku.h \
--vapi=libsudoku.vapi
diff --git a/lib/sudoku-generator.vala b/lib/sudoku-generator.vala
index cb34444..c2b1c47 100644
--- a/lib/sudoku-generator.vala
+++ b/lib/sudoku-generator.vala
@@ -29,8 +29,8 @@ public class SudokuGenerator : Object
var boards_list = new ArrayList<SudokuBoard> ();
var boards = new SudokuBoard[nboards];
-// var sysinfo = GLibtop.glibtop_sysinfo.get_sysinfo ();
-// stdout.printf ("ncpus = %d\n", sysinfo.ncpu);
+// var sysinfo = GTop.glibtop_get_sysinfo ();
+// stdout.printf ("ncpus = %d\n", (int) sysinfo.ncpu);
var ncpu = 4;
var nthreads = int.min (ncpu, nboards);
var base_nsudokus_each = nboards / nthreads;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]