Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.etrice.doc/help/Whydoesitworkandwhyisitsafe.html')
-rw-r--r--plugins/org.eclipse.etrice.doc/help/Whydoesitworkandwhyisitsafe.html48
1 files changed, 48 insertions, 0 deletions
diff --git a/plugins/org.eclipse.etrice.doc/help/Whydoesitworkandwhyisitsafe.html b/plugins/org.eclipse.etrice.doc/help/Whydoesitworkandwhyisitsafe.html
new file mode 100644
index 000000000..cb5cf3864
--- /dev/null
+++ b/plugins/org.eclipse.etrice.doc/help/Whydoesitworkandwhyisitsafe.html
@@ -0,0 +1,48 @@
+<html>
+<head>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Why does it work and why is it safe?</title>
+<link href="book.css" rel="stylesheet" type="text/css">
+<meta content="DocBook XSL Stylesheets V1.75.1" name="generator">
+<link rel="home" href="index.html" title="eTrice User Guide">
+<link rel="up" href="TutorialPedestrianLights.html" title="Tutorial Pedestrian Lights">
+<link rel="prev" href="Setupthemodel.html" title="Setup the model">
+<link rel="next" href="ROOMConcepts.html" title="ROOM Concepts">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<h1 xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">Why does it work and why is it safe?</h1>
+<div class="section" title="Why does it work and why is it safe?">
+<div class="titlepage">
+<div>
+<div>
+<h2 class="title" style="clear: both">
+<a name="Whydoesitworkandwhyisitsafe"></a>Why does it work and why is it safe?</h2>
+</div>
+</div>
+</div>
+<p>The tutorial shows that it is generally possible to use every port from outside the model as long as the port knows its peer. This is guaranteed by describing protocol and the complete structure (especially the bindings) within the model.
+ The only remaining question is: Why is it safe and does not violate the &bdquo;run to completion&rdquo; semantic. To answer this question, take a look at the
+ [<span class="citation">MessageService.java</span>] from the runtime environment. There you will find the receive method which puts each message into the queue.
+ </p>
+<div class="literallayout">
+<p>
+<code class="code"> @Override<br>
+ public&nbsp;synchronized&nbsp;void&nbsp;receive(Message&nbsp;msg)&nbsp;{<br>
+ if&nbsp;(msg!=null)&nbsp;{<br>
+ messageQueue.push(msg);<br>
+ notifyAll();&nbsp;//&nbsp;wake&nbsp;up&nbsp;thread&nbsp;to&nbsp;compute&nbsp;message<br>
+ }<br>
+ }<br>
+
+</code>
+</p>
+</div>
+<div class="blockquote">
+<blockquote class="blockquote">
+<p></p>
+</blockquote>
+</div>
+<p>This method is synchronized. That means, regardless who sends the message, the queue is secured. If we later on (e.g. for performance reasons in C/C++) distinguish between internal and external senders (same thread or not), care must be taken to use the external (secure) queue.</p>
+</div>
+</body>
+</html>

Back to the top