<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0" xmlns:osnews="http://www.osnews.com/rss2#">
	<channel>
		<title>OSNews: </title>
		<link>http://www.osnews.com/story/24786/Genode_11_05_Gets_New_API_for_Type-safe_IPC_Runs_L4Linux</link>
		<description>Exploring the Future of Computing</description>
		<language>en-us</language>
		<copyright>Copyright 2001-2013, David Adams</copyright>
		<webMaster>adam+nospam@osnews.com</webMaster>
		<lastBuildDate>Tue, 18 Jun 2013 22:38:48 GMT</lastBuildDate>
		<image>
			<url>http://www.osnews.com/images/osnews.gif</url>
			<title>OSNews.com</title>
			<link>http://www.osnews.com</link>
		</image>
		<item>
			<title>Very nice</title>
			<link>http://www.osnews.com/thread?474713</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?474713</guid>
			<description>Very nice Genode team.</description>
			<pubDate>Thu, 26 May 2011 14:54:00 GMT</pubDate>
			<author>donotreply@osnews.com (poundsmack)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE: Very nice</title>
			<link>http://www.osnews.com/thread?474722</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?474722</guid>
			<description>Indeed.  This project is very interesting, and keeps moving forward.<br />
<br />
I really need to set aside some time to play with it.</description>
			<pubDate>Thu, 26 May 2011 16:17:00 GMT</pubDate>
			<author>donotreply@osnews.com (Pro-Competition)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>Best approach is shared memory buffers.</title>
			<link>http://www.osnews.com/thread?474799</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?474799</guid>
			<description>I don't see why messages have go through the kernel. For me, the best approach for interprocess communication on the same machine is to have two processes share memory, and then when a process A wants to send a message to another process B, then process A simply allocates a buffer from the shared memory, and then informs process B about the message via a semaphore. Then process B reads the message, copies it into a private memory, and then checks it.<br />
<br />
In this way, there is no need for context swapping; the kernel need not be invoked at all.</description>
			<pubDate>Fri, 27 May 2011 10:19:00 GMT</pubDate>
			<author>donotreply@osnews.com (axilmar)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE: Best approach is shared memory buffers.</title>
			<link>http://www.osnews.com/thread?474801</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?474801</guid>
			<description><div class="cquote">I don't see why messages have go through the kernel. For me, the best approach for interprocess communication on the same machine is to have two processes share memory, and then when a process A wants to send a message to another process B, then process A simply allocates a buffer from the shared memory, and then informs process B about the message via a semaphore. Then process B reads the message, copies it into a private memory, and then checks it.<br />
<br />
In this way, there is no need for context swapping; the kernel need not be invoked at all. </div><br />
<br />
(1) A single memory shared by everything is a bottleneck in multiprocessor systems. Caches don't solve this problem, they only hide it behind the cache coherency protocol.<br />
<br />
(2) &quot;Going through the kernel&quot; is only slow if you make it slow.</description>
			<pubDate>Fri, 27 May 2011 10:34:00 GMT</pubDate>
			<author>donotreply@osnews.com (Morin)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE: Best approach is shared memory buffers.</title>
			<link>http://www.osnews.com/thread?474805</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?474805</guid>
			<description><div class="cquote">... then when a process A wants to send a message to another process B, then process A simply allocates a buffer from the shared memory, and then informs process B about the message via a semaphore. Then process B reads the message, copies it into a private memory, and then checks it. In this way, there is no need for context swapping; the kernel need not be invoked at all. </div><br />
<br />
Isn't the <i>semaphore</i> also a kernel-provided mechanism, which forces both processes to synchronize via kernel entries? Also, the usage of a shared-memory communication comes not for free as one has to establish the shared memory with each communication partner, allocate buffers in the shared memory, maybe allocate control packets, acknowledge completed messages for buffer reuse and maybe unblock the sender that wants to marshal the next message. From our experience with Genode, this pays off for bulk-data transfer but not for most RPCs with just a few register words of payload.<br />
<br />
Modern microkernels like Fiasco.OC support fast inter-process communication with a user-level accessible part of the thread control block - UTCB - with a size of about 64 register words or something more. Processes marshal their message payload into the UTCB, the kernel copies from sender to receiver UTCB, and, finally, the receiver demarshals the data out of the UTCB as needed. Performance-wise this should fit the approach you described, the time for the copy operation is bounded by UTCB size, and there's no shared-memory establishment overhead as only the kernel accesses both UTCBs.</description>
			<pubDate>Fri, 27 May 2011 11:16:00 GMT</pubDate>
			<author>donotreply@osnews.com (krishna)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE[2]: Best approach is shared memory buffers.</title>
			<link>http://www.osnews.com/thread?474821</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?474821</guid>
			<description><div class="cquote">"<i>I don't see why messages have go through the kernel. For me, the best approach for interprocess communication on the same machine is to have two processes share memory, and then when a process A wants to send a message to another process B, then process A simply allocates a buffer from the shared memory, and then informs process B about the message via a semaphore. Then process B reads the message, copies it into a private memory, and then checks it.<br />
<br />
In this way, there is no need for context swapping; the kernel need not be invoked at all. </div><br />
<br />
(1) A single memory shared by everything is a bottleneck in multiprocessor systems. Caches don't solve this problem, they only hide it behind the cache coherency protocol. </i>"<br />
<br />
Sharing always have bottlenecks (fundamentally from the speed of light). Sharing memory with caching-aware semantics is the fastest communication a standard processor can have, even pure message passing like the basic QNX primitives still use the same shared memory mechanism.<br />
<br />
<div class="cquote"><br />
(2) &quot;Going through the kernel&quot; is only slow if you make it slow. </div><br />
<br />
Like on x86? Depending on the processor and the kernel/user design a pure enter/exit of kernel mode can take some 1000s of clocks (including stalls due to cache/TLB evictions). Add the overhead of the operation. (I am aware that pure null-operations are considerably faster however real code have real overheads) <br />
<br />
This means that user-level communications with shared memory can in many cases do spin-locks with lower overheads than using any kernel primitives. Spin+fallback to kernel synchronization is very effective.</description>
			<pubDate>Fri, 27 May 2011 14:34:00 GMT</pubDate>
			<author>donotreply@osnews.com (Megol)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE[2]: Best approach is shared memory buffers.</title>
			<link>http://www.osnews.com/thread?474840</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?474840</guid>
			<description><div class="cquote">A single memory shared by everything is a bottleneck in multiprocessor systems. Caches don't solve this problem, they only hide it behind the cache coherency protocol. </div><br />
<br />
You can always have shared memory per process couple (sender-receiver).<br />
<br />
<div class="cquote">&quot;Going through the kernel&quot; is only slow if you make it slow. </div><br />
<br />
In modern 80x86 CPUs, it's very slow. It's also always slower than if you don't go through the kernel.</description>
			<pubDate>Fri, 27 May 2011 16:26:00 GMT</pubDate>
			<author>donotreply@osnews.com (axilmar)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE[2]: Best approach is shared memory buffers.</title>
			<link>http://www.osnews.com/thread?474842</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?474842</guid>
			<description><div class="cquote">Isn't the semaphore also a kernel-provided mechanism, which forces both processes to synchronize via kernel entries? </div><br />
<br />
It doesn't have to be a kernel object.<br />
<br />
<div class="cquote">Also, the usage of a shared-memory communication comes not for free as one has to establish the shared memory with each communication partner </div> <br />
<br />
Not a problem. The virtual memory subsystem can take care of that.<br />
<br />
<div class="cquote">allocate buffers in the shared memory </div><br />
<br />
Can be done via mutexes (not kernel objects) in shared memory.<br />
<br />
<div class="cquote">acknowledge completed messages for buffer reuse </div><br />
<br />
The buffers are simply freed from the shared memory.<br />
<br />
<div class="cquote">maybe unblock the sender that wants to marshal the next message </div><br />
<br />
Atomically increment the semaphore. If the other CPU spins on the semaphore (i.e. it's a spin lock), then the other process will be unblocked.<br />
<br />
<div class="cquote">Modern microkernels like Fiasco.OC support fast inter-process communication with a user-level accessible part of the thread control block - UTCB - with a size of about 64 register words or something more. Processes marshal their message payload into the UTCB, the kernel copies from sender to receiver UTCB, and, finally, the receiver demarshals the data out of the UTCB as needed. Performance-wise this should fit the approach you described, the time for the copy operation is bounded by UTCB size, and there's no shared-memory establishment overhead as only the kernel accesses both UTCBs. </div><br />
<br />
The 80x86 CPU doesn't have 64 registers available for users. Furthermore, you still do two kernel switches. I think the shared memory approach is faster, at least on 80x86.</description>
			<pubDate>Fri, 27 May 2011 16:31:00 GMT</pubDate>
			<author>donotreply@osnews.com (axilmar)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE: Best approach is shared memory buffers.</title>
			<link>http://www.osnews.com/thread?474948</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?474948</guid>
			<description><div class="cquote">I don't see why messages have go through the kernel. For me, the best approach for interprocess communication on the same machine is to have two processes share memory </div><br />
<br />
This is done of course whenever two tasks have to communicate frequently.<br />
<br />
But first you need to negotiate this shared memory and enforce access control between tasks. So IPC via kernel is always the first step. And if you don't expect to communicate often, establishing shared mem is only overhead.<br />
<br />
IPC performance is indeed a major performance criterion for microkernel systems, but modern kernels can do this quite fast.</description>
			<pubDate>Sun, 29 May 2011 18:32:00 GMT</pubDate>
			<author>donotreply@osnews.com (pepper)</author>
			<category>Comments</category>
		</item>
	</channel>
</rss>
