Index: base-foc/src/core/include/platform_thread.h
===================================================================
--- base-foc/src/core/include/platform_thread.h	(revision 156)
+++ base-foc/src/core/include/platform_thread.h	(working copy)
@@ -64,7 +64,7 @@
 			/**
 			 * Constructor for non-core threads
 			 */
-			Platform_thread(const char *name, unsigned priority);
+			Platform_thread(const char *name, unsigned priority, unsigned cpu);
 
 			/**
 			 * Constructor for core main-thread
Index: base-foc/src/core/include/cpu_session_component.h
===================================================================
--- base-foc/src/core/include/cpu_session_component.h	(revision 156)
+++ base-foc/src/core/include/cpu_session_component.h	(working copy)
@@ -52,8 +52,8 @@
 
 		public:
 
-			Cpu_thread_component(const char *name, unsigned priority)
-			: _platform_thread(name, priority), _bound(false) { }
+			Cpu_thread_component(const char *name, unsigned priority, unsigned cpu)
+			: _platform_thread(name, priority, cpu), _bound(false) { }
 
 
 			/************************
@@ -86,6 +86,7 @@
 			unsigned                   _priority;          /* priority of threads
 			                                                  created with this
 			                                                  session */
+			unsigned                   _default_cpu;
 
 			/**
 			 * Lookup thread in CPU session by its capability
Index: base-foc/src/core/platform_thread.cc
===================================================================
--- base-foc/src/core/platform_thread.cc	(revision 156)
+++ base-foc/src/core/platform_thread.cc	(working copy)
@@ -194,7 +194,8 @@
 
 
 Platform_thread::Platform_thread(const char *name,
-                                 unsigned    prio)
+                                 unsigned    prio,
+                                 unsigned    cpu)
 : _core_thread(false),
   _thread_cap(Capability_allocator::allocator()->alloc(),
               Badge_allocator::allocator()->alloc()),
@@ -203,6 +204,8 @@
   _platform_pd(0),
   _pager(0)
 {
+	PDBG("constructing new thread on CPU %d", cpu);
+
 	/* register the thread capability */
 	Capability_tree::tree()->insert(&_node);
 
Index: os/include/init/child.h
===================================================================
--- os/include/init/child.h	(revision 156)
+++ os/include/init/child.h	(working copy)
@@ -51,6 +51,15 @@
 	}
 
 
+	inline long read_cpu(Genode::Xml_node start_node)
+	{
+		long cpu = 0;
+		try { start_node.attribute("cpu").value(&cpu); }
+		catch (...) { }
+		return cpu;
+	}
+
+
 	inline Genode::size_t read_ram_quota(Genode::Xml_node start_node)
 	{
 		Genode::Number_of_bytes ram_quota = 0;
@@ -305,6 +314,7 @@
 			{
 				long                   prio_levels_log2;
 				long                   priority;
+				long                   default_cpu;
 				Genode::size_t         ram_quota;
 				Genode::Ram_connection ram;
 				Genode::Cpu_connection cpu;
@@ -315,9 +325,12 @@
 				:
 					prio_levels_log2(prio_levels_log2),
 					priority(read_priority(start_node)),
+					default_cpu(read_cpu(start_node)),
 					ram_quota(read_ram_quota(start_node)),
 					ram(label),
-					cpu(label, priority*(Genode::Cpu_session::PRIORITY_LIMIT >> prio_levels_log2))
+					cpu(label,
+					    priority*(Genode::Cpu_session::PRIORITY_LIMIT >> prio_levels_log2),
+					    default_cpu)
 				{
 					/* deduce session costs from usable ram quota */
 					enum { RM = 64*1024, CPU = 16*1024, RAM = 32*1024 };
Index: os/run/demo.run
===================================================================
--- os/run/demo.run	(revision 156)
+++ os/run/demo.run	(working copy)
@@ -74,7 +74,7 @@
 		<resource name="RAM" quantum="1M"/>
 		<provides><service name="Timer"/></provides>
 	</start>
-	<start name="nitpicker">
+	<start name="nitpicker" cpu="13">
 		<resource name="RAM" quantum="1M"/>
 		<provides><service name="Nitpicker"/></provides>
 	</start>
Index: base/include/cpu_session/connection.h
===================================================================
--- base/include/cpu_session/connection.h	(revision 156)
+++ base/include/cpu_session/connection.h	(working copy)
@@ -30,13 +30,14 @@
 			 * \param label     initial session label
 			 * \param priority  designated priority of all threads created
 			 *                  with this CPU session
+			 * \param cpu       CPU used to execute threads created via the CPU session
 			 */
-			Cpu_connection(const char *label = "", long priority = DEFAULT_PRIORITY)
+			Cpu_connection(const char *label = "", long priority = DEFAULT_PRIORITY, long cpu = 0)
 			:
 				Connection<Cpu_session_capability>(
 					session(service_name(),
-					        "priority=0x%lx, ram_quota=32K, label=\"%s\"",
-					        priority, label)),
+					        "priority=0x%lx, cpu=%ld, ram_quota=32K, label=\"%s\"",
+					        priority, cpu, label)),
 				Cpu_session_client(cap()) { }
 	};
 }
Index: base/src/core/cpu_session_component.cc
===================================================================
--- base/src/core/cpu_session_component.cc	(revision 156)
+++ base/src/core/cpu_session_component.cc	(working copy)
@@ -30,7 +30,7 @@
 
 	Cpu_thread_component *thread = 0;
 	try {
-		thread = new(&_slab) Cpu_thread_component(name, _priority);
+		thread = new(&_slab) Cpu_thread_component(name, _priority, _default_cpu);
 	} catch (Allocator::Out_of_memory) {
 		throw Thread_creation_failed();
 	}
@@ -164,7 +164,7 @@
                                              const char *args)
 : _thread_ep(thread_ep), _pager_ep(pager_ep),
   _md_alloc(md_alloc, Arg_string::find_arg(args, "ram_quota").long_value(0)),
-  _slab(&_md_alloc), _priority(0)
+  _slab(&_md_alloc), _priority(0), _default_cpu(0)
 {
 	Arg a = Arg_string::find_arg(args, "priority");
 	if (a.valid()) {
@@ -173,6 +173,12 @@
 		/* clamp priority value to valid range */
 		_priority = min((unsigned)PRIORITY_LIMIT - 1, _priority);
 	}
+
+	a = Arg_string::find_arg(args, "cpu");
+	if (a.valid())
+		_default_cpu = a.ulong_value(0);
+
+	PDBG("new CPU session uses CPU %d as default", _default_cpu);
 }
 
 
