<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Java Actors with Kilim</title>
	<atom:link href="http://tech.puredanger.com/index.php/2009/01/07/java-actors-with-kilim/feed/" rel="self" type="application/rss+xml" />
	<link>http://tech.puredanger.com/2009/01/07/java-actors-with-kilim/</link>
	<description>Alex Miller&#039;s technical blog</description>
	<lastBuildDate>Mon, 06 Feb 2012 19:39:50 -0800</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
	<item>
		<title>By: Anonymous</title>
		<link>http://tech.puredanger.com/2009/01/07/java-actors-with-kilim/comment-page-1/#comment-239213</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Tue, 03 Aug 2010 16:41:46 +0000</pubDate>
		<guid isPermaLink="false">http://tech.puredanger.com/2009/01/07/java-actors-with-kilim/#comment-239213</guid>
		<description>Why care if  Kilim is successful Java framework or not, it has anyway taught us a new way of doing things in life. Come up with a Java framework, release it as open source and take credit from Java community. On the other hand, at the back force fit some E=mc2 theory to it and present it to University for getting a PhD degree, thereby killing two birds in one stone. Extremely smart, way to go!

Universities anyway get free dollars from Uncle Sam, so they can afford to be Santa Claus to award PhDs to Java frameworks or perhaps to even product manuals! 

Research is no more about being selfless and working for benefit of mankind. It is about outsmarting the system to get a degree!

“I never perfected an invention that I did not think about in terms of the service it might give others... I find out what the world needs, then I proceed to invent....” - Thomas Alva Edison</description>
		<content:encoded><![CDATA[<p>Why care if  Kilim is successful Java framework or not, it has anyway taught us a new way of doing things in life. Come up with a Java framework, release it as open source and take credit from Java community. On the other hand, at the back force fit some E=mc2 theory to it and present it to University for getting a PhD degree, thereby killing two birds in one stone. Extremely smart, way to go!</p>
<p>Universities anyway get free dollars from Uncle Sam, so they can afford to be Santa Claus to award PhDs to Java frameworks or perhaps to even product manuals! </p>
<p>Research is no more about being selfless and working for benefit of mankind. It is about outsmarting the system to get a degree!</p>
<p>“I never perfected an invention that I did not think about in terms of the service it might give others&#8230; I find out what the world needs, then I proceed to invent&#8230;.” &#8211; Thomas Alva Edison</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sakshi Rastogi</title>
		<link>http://tech.puredanger.com/2009/01/07/java-actors-with-kilim/comment-page-1/#comment-215050</link>
		<dc:creator>Sakshi Rastogi</dc:creator>
		<pubDate>Wed, 16 Jun 2010 07:02:42 +0000</pubDate>
		<guid isPermaLink="false">http://tech.puredanger.com/2009/01/07/java-actors-with-kilim/#comment-215050</guid>
		<description>Dear All,
I wrote the following function in Task.java.
 

    public Thread Terminate(){
            Thread w=this.currentThread;
            System.out.println(&quot;Terminate!&quot;);
            this.done=true;
            return w;
        }
        public void Replace(Thread w){
            this.pinToThread();
            WorkerThread wt=new WorkerThread(this.scheduler);
            this.preferredResumeThread=wt;
        }


I call them from MyTask.java::

    package kilim.examples;

    import kilim.Mailbox;
    import kilim.Pausable;
    import kilim.Task;

    public class MyTask extends Task {
        static Mailbox mb = new Mailbox();
     
        public static void main(String[] args) throws Exception {
            Task t = new MyTask().start();
            Thread.sleep(10);
            System.out.println(t.id());
            mb.putnb(&quot;First_Task\n&quot;);
            mb.putnb(&quot;Sakshi_Here\n&quot;);
            Thread w=t.Terminate();
            Task tt=new MyTask();
            tt.Replace(w);
            tt.start();
            System.out.println(tt.id());
            mb.putnb(&quot;Second_Task\n&quot;);
            mb.putnb(&quot;Sakshi_again\n&quot;);
            mb.putnb(&quot;done&quot;);
            System.exit(0);
        }

        public void execute() throws Pausable {
           
            while (true) {
               
                String s = mb.get();
              
                if (s.equals(&quot;done&quot;))
                    break;
                System.out.print(s);
            }
            System.exit(0);
        }
    }


Though it seems to work yet..I am not sure of its correctness. Kindly guide me.</description>
		<content:encoded><![CDATA[<p>Dear All,<br />
I wrote the following function in Task.java.</p>
<p>    public Thread Terminate(){<br />
            Thread w=this.currentThread;<br />
            System.out.println(&#8220;Terminate!&#8221;);<br />
            this.done=true;<br />
            return w;<br />
        }<br />
        public void Replace(Thread w){<br />
            this.pinToThread();<br />
            WorkerThread wt=new WorkerThread(this.scheduler);<br />
            this.preferredResumeThread=wt;<br />
        }</p>
<p>I call them from MyTask.java::</p>
<p>    package kilim.examples;</p>
<p>    import kilim.Mailbox;<br />
    import kilim.Pausable;<br />
    import kilim.Task;</p>
<p>    public class MyTask extends Task {<br />
        static Mailbox mb = new Mailbox();</p>
<p>        public static void main(String[] args) throws Exception {<br />
            Task t = new MyTask().start();<br />
            Thread.sleep(10);<br />
            System.out.println(t.id());<br />
            mb.putnb(&#8220;First_Task\n&#8221;);<br />
            mb.putnb(&#8220;Sakshi_Here\n&#8221;);<br />
            Thread w=t.Terminate();<br />
            Task tt=new MyTask();<br />
            tt.Replace(w);<br />
            tt.start();<br />
            System.out.println(tt.id());<br />
            mb.putnb(&#8220;Second_Task\n&#8221;);<br />
            mb.putnb(&#8220;Sakshi_again\n&#8221;);<br />
            mb.putnb(&#8220;done&#8221;);<br />
            System.exit(0);<br />
        }</p>
<p>        public void execute() throws Pausable {</p>
<p>            while (true) {</p>
<p>                String s = mb.get();</p>
<p>                if (s.equals(&#8220;done&#8221;))<br />
                    break;<br />
                System.out.print(s);<br />
            }<br />
            System.exit(0);<br />
        }<br />
    }</p>
<p>Though it seems to work yet..I am not sure of its correctness. Kindly guide me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sakshi Rastogi</title>
		<link>http://tech.puredanger.com/2009/01/07/java-actors-with-kilim/comment-page-1/#comment-215029</link>
		<dc:creator>Sakshi Rastogi</dc:creator>
		<pubDate>Wed, 16 Jun 2010 05:48:13 +0000</pubDate>
		<guid isPermaLink="false">http://tech.puredanger.com/2009/01/07/java-actors-with-kilim/#comment-215029</guid>
		<description>Dear All,
I want to add a new function to terminate the running task and replace it with another task that should run on the same thread that was being used by the task to be terminated. That is the following functions have to be added::

    public Thread Terminate(){
    this.done=true;
    Thread th=Thread.currentThread();
    return th;
    }

    public void Replace(Task t,Thread w){

    //Assigns task the thread w and runs it.

    }


Kindly guide me regarding the second method and correct me if I am wrong in writing the first method.
I am writing these methods in Task.java. They will be called from the subclass of Task.java.

[P.S.: I have understood the execute() method mystery I had put forward in the previous post. Thanks to Alex Sir.]</description>
		<content:encoded><![CDATA[<p>Dear All,<br />
I want to add a new function to terminate the running task and replace it with another task that should run on the same thread that was being used by the task to be terminated. That is the following functions have to be added::</p>
<p>    public Thread Terminate(){<br />
    this.done=true;<br />
    Thread th=Thread.currentThread();<br />
    return th;<br />
    }</p>
<p>    public void Replace(Task t,Thread w){</p>
<p>    //Assigns task the thread w and runs it.</p>
<p>    }</p>
<p>Kindly guide me regarding the second method and correct me if I am wrong in writing the first method.<br />
I am writing these methods in Task.java. They will be called from the subclass of Task.java.</p>
<p>[P.S.: I have understood the execute() method mystery I had put forward in the previous post. Thanks to Alex Sir.]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex Miller</title>
		<link>http://tech.puredanger.com/2009/01/07/java-actors-with-kilim/comment-page-1/#comment-211931</link>
		<dc:creator>Alex Miller</dc:creator>
		<pubDate>Sat, 12 Jun 2010 11:43:19 +0000</pubDate>
		<guid isPermaLink="false">http://tech.puredanger.com/2009/01/07/java-actors-with-kilim/#comment-211931</guid>
		<description>@Sakshi: The NodeActor is a subclass of Task which is a subclass of java.lang.Thread.  When start() is called on the Thread, the run() method will be called by the JVM.  The run() method is defined in Task and will call the execute() method.  This is a classic example of the Template design pattern.</description>
		<content:encoded><![CDATA[<p>@Sakshi: The NodeActor is a subclass of Task which is a subclass of java.lang.Thread.  When start() is called on the Thread, the run() method will be called by the JVM.  The run() method is defined in Task and will call the execute() method.  This is a classic example of the Template design pattern.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sakshi</title>
		<link>http://tech.puredanger.com/2009/01/07/java-actors-with-kilim/comment-page-1/#comment-211789</link>
		<dc:creator>Sakshi</dc:creator>
		<pubDate>Sat, 12 Jun 2010 07:49:10 +0000</pubDate>
		<guid isPermaLink="false">http://tech.puredanger.com/2009/01/07/java-actors-with-kilim/#comment-211789</guid>
		<description>Sir,
I am new bee to Thread Programming. Kindly enlighten me on the fact that who calls execute() method defined in the subclasses of Task.java in Kilim.
Sakshi.</description>
		<content:encoded><![CDATA[<p>Sir,<br />
I am new bee to Thread Programming. Kindly enlighten me on the fact that who calls execute() method defined in the subclasses of Task.java in Kilim.<br />
Sakshi.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

