<?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: Userland Multitasking: Introduction</title>
	<atom:link href="http://jacobsantos.com/2007/writing-projects/opcode-theory-userland-multitasking-introduction/feed/" rel="self" type="application/rss+xml" />
	<link>http://jacobsantos.com/2007/writing-projects/opcode-theory-userland-multitasking-introduction/</link>
	<description>Rumblings, rants, essays, stories by Jacob Santos about Web Site Development, Persistent Browser-Based Games, personal journal, and Programming.</description>
	<lastBuildDate>Wed, 08 Feb 2012 15:54:15 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3-aortic-dissection</generator>
	<item>
		<title>By: Jacob Santos</title>
		<link>http://jacobsantos.com/2007/writing-projects/opcode-theory-userland-multitasking-introduction/comment-page-1/#comment-3462</link>
		<dc:creator>Jacob Santos</dc:creator>
		<pubDate>Sun, 18 Mar 2007 01:36:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.santosj.name/programming/php-related/php-opcode/opcode-theory-userland-multitasking-introduction/#comment-3462</guid>
		<description>I agree that it would be very complicated. I wrote the beginnings of this back when I wanted to learn and practice multitasking programming. Practice makes perfect, but to add it to the PHP engine? Yeah, I need years and years more real-world experience before I&#039;m able to do that. 

I am still interested in learning ticks now. Had an idea for a library, but never got around to developing it. More on the side of learning and &quot;Just for Fun&quot; than anything useful.

It is something that could be possible in the environments that would allow it. My thoughts is that it should be (1) really easy for the user and (2) completely managed so the user couldn&#039;t screw the process the thread is in. How that is implemented in PHP? Well, I&#039;m just going to take a look at just what it would look like in the executor and script.</description>
		<content:encoded><![CDATA[<p>I agree that it would be very complicated. I wrote the beginnings of this back when I wanted to learn and practice multitasking programming. Practice makes perfect, but to add it to the PHP engine? Yeah, I need years and years more real-world experience before I&#8217;m able to do that. </p>
<p>I am still interested in learning ticks now. Had an idea for a library, but never got around to developing it. More on the side of learning and &#8220;Just for Fun&#8221; than anything useful.</p>
<p>It is something that could be possible in the environments that would allow it. My thoughts is that it should be (1) really easy for the user and (2) completely managed so the user couldn&#8217;t screw the process the thread is in. How that is implemented in PHP? Well, I&#8217;m just going to take a look at just what it would look like in the executor and script.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sara Golemon</title>
		<link>http://jacobsantos.com/2007/writing-projects/opcode-theory-userland-multitasking-introduction/comment-page-1/#comment-3449</link>
		<dc:creator>Sara Golemon</dc:creator>
		<pubDate>Sat, 17 Mar 2007 16:30:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.santosj.name/programming/php-related/php-opcode/opcode-theory-userland-multitasking-introduction/#comment-3449</guid>
		<description>The problem with tick based threading as a fallback (which, by the way, you can implement to a limited extent right now by using Runkit_Sandbox), is preemption.

In many cases, a tick is a very short unit of time:

$a = $b + $c;
echo $a;

But in many other cases, a tick can take quite long, even an indefinite period:

sleep(1000);
$result = `shell process`;
$line = fread($sock, 8192); /* blocking */

Of course, one could always fork off a process thread, but this complicates interaction between threads (need to use shm or ipc or some other mechanism).

Userspace threading is the sort of thing which could be done, but it&#039;s a big, complicated mess...</description>
		<content:encoded><![CDATA[<p>The problem with tick based threading as a fallback (which, by the way, you can implement to a limited extent right now by using Runkit_Sandbox), is preemption.</p>
<p>In many cases, a tick is a very short unit of time:</p>
<p>$a = $b + $c;<br />
echo $a;</p>
<p>But in many other cases, a tick can take quite long, even an indefinite period:</p>
<p>sleep(1000);<br />
$result = `shell process`;<br />
$line = fread($sock, 8192); /* blocking */</p>
<p>Of course, one could always fork off a process thread, but this complicates interaction between threads (need to use shm or ipc or some other mechanism).</p>
<p>Userspace threading is the sort of thing which could be done, but it&#8217;s a big, complicated mess&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

