<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://95.179.246.60/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Processes_101</id>
	<title>Processes 101 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://95.179.246.60/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Processes_101"/>
	<link rel="alternate" type="text/html" href="http://95.179.246.60/mediawiki/index.php?title=Processes_101&amp;action=history"/>
	<updated>2026-05-08T12:44:47Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.17</generator>
	<entry>
		<id>http://95.179.246.60/mediawiki/index.php?title=Processes_101&amp;diff=118&amp;oldid=prev</id>
		<title>Nmingott: imported material</title>
		<link rel="alternate" type="text/html" href="http://95.179.246.60/mediawiki/index.php?title=Processes_101&amp;diff=118&amp;oldid=prev"/>
		<updated>2025-05-04T21:30:50Z</updated>

		<summary type="html">&lt;p&gt;imported material&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;* Here we see how to &amp;#039;&amp;#039;&amp;#039;create&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;name&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;prioritize&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;suspend&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;resume&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;terminate&amp;#039;&amp;#039;&amp;#039; a process. &lt;br /&gt;
* Open a &amp;#039;&amp;#039;&amp;#039;Transcript&amp;#039;&amp;#039;&amp;#039; window and a the &amp;#039;&amp;#039;&amp;#039;ProcessBrowser&amp;#039;&amp;#039;&amp;#039; ( for example clicking &amp;lt;code&amp;gt;World -&amp;gt; Open -&amp;gt; Process Browser&amp;lt;/code&amp;gt; ) keep them open and run what&amp;#039;s next.&lt;br /&gt;
* We &amp;#039;&amp;#039;&amp;#039;create a process&amp;#039;&amp;#039;&amp;#039; that every second prints in the Transcript window a text line and random number after it, like this:&lt;br /&gt;
&lt;br /&gt;
 pr1 _ [ [true] whileTrue: [ &lt;br /&gt;
         Transcript log: &amp;#039;process runnning -- id: &amp;#039;, (100 atRandom asString) .&lt;br /&gt;
          (Delay forDuration: (Duration seconds: 1)) wait.&lt;br /&gt;
         ] ] newProcess.&lt;br /&gt;
&lt;br /&gt;
* You should see already pr1 in the ProcessBrowser, but &amp;#039;&amp;#039;&amp;#039;let&amp;#039;s give it a name&amp;#039;&amp;#039;&amp;#039; so you will see it better&lt;br /&gt;
&lt;br /&gt;
 pr1 name: &amp;#039;test --- pr1&amp;#039;. &lt;br /&gt;
&lt;br /&gt;
* You should also see in the ProcessBrowser, on the left side, the priority of out new process is 40. As the Morphic UI. We don&amp;#039;t like that, we want our processes to have inferior priority in general, just to be sure they are not going to starve our user interface.&lt;br /&gt;
* We &amp;#039;&amp;#039;&amp;#039;change the priority&amp;#039;&amp;#039;&amp;#039; of a process with:&lt;br /&gt;
&lt;br /&gt;
 pr1 priority: 30. &lt;br /&gt;
 &amp;quot; or, with more readability and no magic numbers &amp;quot;&lt;br /&gt;
 pr1 priority: (ProcessorScheduler userBackgroundPriority).&lt;br /&gt;
&lt;br /&gt;
* In the Transcript window you still see no output, indeed the process is by default in a &amp;#039;&amp;#039;&amp;#039;suspended state&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
 pr1 isSuspended .       &amp;quot;=&amp;gt; true &amp;quot;&lt;br /&gt;
&lt;br /&gt;
* let&amp;#039;s &amp;#039;&amp;#039;&amp;#039;activate the process&amp;#039;&amp;#039;&amp;#039; sending it the &amp;lt;code&amp;gt;resume&amp;lt;/code&amp;gt; message.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;pr1 resume.&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* now you see stuff getting printed in the Transcript&lt;br /&gt;
* try to &amp;#039;&amp;#039;&amp;#039;freeze it&amp;#039;&amp;#039;&amp;#039; sending the &amp;lt;code&amp;gt;suspend&amp;lt;/code&amp;gt; message&lt;br /&gt;
&lt;br /&gt;
 pr1 suspend. &lt;br /&gt;
&lt;br /&gt;
* When you are sick of the of resume and suspend  and you just want to get rid of the process then &amp;#039;&amp;#039;&amp;#039;kill it&amp;#039;&amp;#039;&amp;#039; with:&lt;br /&gt;
&lt;br /&gt;
 pr1 terminate. &lt;br /&gt;
&lt;br /&gt;
* Observe that after this you can&amp;#039;t see the process in ProcessBrowser any more.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Exercise&amp;#039;&amp;#039;&amp;#039;. The &amp;#039;bomb&amp;#039;, a process that will make you loose control of Cuis. Be sure you have nothing to loose in your running Cuis. Redefine &amp;#039;&amp;#039;&amp;#039;pr1&amp;#039;&amp;#039;&amp;#039; without the 1 second delay. Make pr1 of priority 30, then run it. You will see line+numbers getting printed  quite fast in the Transcript but still, you have control of the user interface. Suspend pr1, give it priority 50, higher than the UI, resume it ... bam ! You are almost fried now. You may be able to recover pressing &amp;lt;code&amp;gt;Alt+.&amp;lt;/code&amp;gt; .&lt;/div&gt;</summary>
		<author><name>Nmingott</name></author>
	</entry>
</feed>