<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -377,5 +377,14 @@ Tasks::Task::Task(u8 cpl):
 		iomap[i] = 0xFF;
 
 	streamsByName = new HashTable&lt;Symbol, Stream *&gt;();
-	queuesByName = new HashTable&lt;Symbol, Queue *&gt;();
+	replyQueue = new Queue();
+}
+
+Tasks::Task::~Task() {
+	if (userCall) delete userCall;
+	// TODO: destroy pageDir? the actual space allocated within the heap?
+	// TODO: do we need to deallocate the Stream*s within streamsByName?
+	// TODO: what about payloads in replyQueue?
+	delete streamsByName;
+	delete replyQueue;
 }</diff>
      <filename>Tasks.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -67,3 +67,5 @@ DEFN_SYSCALL5(readStreamUnblock, 17, const char *, const char *, u32, char *, u3
 DEFN_SYSCALL5(writeStream, 18, const char *, const char *, u32, const char *, u32);
 
 DEFN_SYSCALL1(registerQueue, 19, const char *);
+DEFN_SYSCALL1(readQueue, 20, const char *);
+DEFN_SYSCALL4(sendQueue, 21, const char *, const char *, u32, u32);</diff>
      <filename>UserGates.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -136,14 +136,14 @@ namespace IPC {
 		return n;		// what else?!
 	}
 
-	bool registerQueue(const char *name) {
-		Symbol sNode(name);
+	bool registerQueue(const char *node) {
+		Symbol sNode(node);
 		if (!Akari-&gt;tasks-&gt;current-&gt;registeredName) {
 			// TODO
 			AkariPanic(&quot;name not registered - cannot register node&quot;);
 		}
 
-		if (Akari-&gt;tasks-&gt;current-&gt;streamsByName-&gt;hasKey(name)) {
+		if (Akari-&gt;tasks-&gt;current-&gt;streamsByName-&gt;hasKey(node)) {
 			AkariPanic(&quot;node already registered - cannot register atop it&quot;);
 		}
 
@@ -153,10 +153,19 @@ namespace IPC {
 		return true;
 	}
 
+	static inline Tasks::Task::Queue *getQueue(Tasks::Task *task, const char *node) {
+		Symbol sNode(node);
+
+		if (!task || !task-&gt;queuesByName-&gt;hasKey(sNode))
+			return 0;
+
+		return (*task-&gt;queuesByName)[sNode];
+	}
+
 	class ReadQueueCall : public BlockingCall {
 	public:
 		// TODO: need to know the current task!
-		ReadQueueCall(const char *node) { }
+		ReadQueueCall(Tasks::Task *task, const char *node) { }
 	};
 
 	u32 readQueue(const char *node) {</diff>
      <filename>UserIPC.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -77,7 +77,10 @@ public:
 		class Queue {
 		public:
 			Queue();
+			
+			u32 length() const;
 
+		protected:
 		};
 
 		static Task *BootstrapInitialTask(u8 cpl, Memory::PageDirectory *pageDirBase);
@@ -110,11 +113,11 @@ public:
 		u8 iomap[32];
 
 		HashTable&lt;Symbol, Stream *&gt; *streamsByName;
-		HashTable&lt;Symbol, Queue *&gt; *queuesByName;
+		Queue *replyQueue;
 
 	protected:
 		Task(u8 cpl);
-
+		~Task();
 	};
 
 	Task *getNextTask();</diff>
      <filename>inc/Tasks.hpp</filename>
    </modified>
    <modified>
      <diff>@@ -35,6 +35,8 @@ DECL_SYSCALL5(readStreamUnblock, const char *, const char *, u32, char *, u32);
 DECL_SYSCALL5(writeStream, const char *, const char *, u32, const char *, u32);
 
 DECL_SYSCALL1(registerQueue, const char *);
+DECL_SYSCALL1(readQueue, const char *);
+DECL_SYSCALL4(sendQueue, const char *, const char *, u32, u32);
 
 #define SYSCALL_BOOL(x) ((bool)((x) &amp; 0xFF))
 </diff>
      <filename>inc/UserGates.hpp</filename>
    </modified>
    <modified>
      <diff>@@ -15,7 +15,9 @@ namespace IPC {
 	u32 readStreamUnblock(const char *name, const char *node, u32 listener, char *buffer, u32 n);
 	u32 writeStream(const char *name, const char *node, u32 writer, const char *buffer, u32 n);
 
-	bool registerQueue(const char *name);
+	bool registerQueue(const char *node);
+	u32 readQueue(const char *node);
+	void sendQueue(const char *name, const char *node, u32 reply_to, u32 value);
 }
 }
 </diff>
      <filename>inc/UserIPC.hpp</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>c0b6b1c61527f90dc50a98d210ebba695b0899a3</id>
    </parent>
  </parents>
  <author>
    <name>Arlen Cuss</name>
    <email>celtic@sairyx.org</email>
  </author>
  <url>http://github.com/celtic/akari/commit/d68ebdbdc7bd39a3e2fadbaca1e6c21a6f4b7c5c</url>
  <id>d68ebdbdc7bd39a3e2fadbaca1e6c21a6f4b7c5c</id>
  <committed-date>2009-11-07T06:13:39-08:00</committed-date>
  <authored-date>2009-11-07T06:13:39-08:00</authored-date>
  <message>Starting to add queue stuff, now that I've sort of worked it out in my head. For now, just one queue - a 'reply' queue (though it can contain non-reply messages i.e. beginnings).</message>
  <tree>c50de2a8cdad2de8ca56ac9ec1be60b9eb478fcd</tree>
  <committer>
    <name>Arlen Cuss</name>
    <email>celtic@sairyx.org</email>
  </committer>
</commit>
