private static void SpawnTask(jpvmTaskId client, jpvmBuffer req) {
		int num = 0;
		String name = null;
		jpvmBuffer buf = new jpvmBuffer();
		try {
			num    = req.upkint();
			name   = req.upkstr();
		}
		catch (jpvmException jpe) {
			perror("bad SpawnTask invocation");
			return;
		}
		if(num==0) {
			buf.pack(num);
			try {
		    		jpvm.pvm_send(buf,client,
				jpvmDaemonMessageTag.jpvmdSpawnTask);
			}
			catch (jpvmException jpe) {
		    		perror("SpawnTask, problem sending "
					+ "to client " +
					client.toString());
			}
			return;
		}

		// Create a work order for the spawn
		jpvmSpawnWorkOrder order;
		order = spawnOrders.newOrder(num);
		order.client = client;

		// Create a request to create a task on a remote host
		jpvmBuffer creq = new jpvmBuffer();
		creq.pack(name); // Pack the class to create
		creq.pack(client); // Pack parent of the created tasks
		creq.pack(order.order);

		// Schedule on known hosts round robin style
		jpvmTaskListRecord target = null;
		for(int i=0; i<num ;i++) {
			if(target==null) target = hosts.firstIter();
			if(target==null) {
				perror("no hosts in SpawnTask invocation");
				return;
			}
			if(target.tid.equals(jpvm.pvm_mytid())) {
				creq.rewind();
				CreateTask(jpvm.pvm_mytid(),creq);
			}
			else {
		    		try {
				   jpvm.pvm_send(creq,target.tid,
					jpvmDaemonMessageTag.jpvmdCreateTask);
		    		}
		    		catch (jpvmException jpe) {
					perror("SpawnTask, error scheduling " +
					    "on host " + target.tid.toString());
		    		}
			}
			target = hosts.nextIter();
		}
	}