* @return
*/
public String getName() {
- Process.ifInterruptedStop();
return MsgNative.taskGetName(this);
}
/** Gets the sender of the task */
Process getSender() {
- Process.ifInterruptedStop();
return MsgNative.taskGetSender(this);
}
/** Gets the source of the task
* @return
*/
public Host getSource() {
- Process.ifInterruptedStop();
return MsgNative.taskGetSource(this);
}
/** Gets the computing amount of the task
* @return
*/
public double getComputeDuration() {
- Process.ifInterruptedStop();
return MsgNative.taskGetComputeDuration(this);
}
/** Gets the remaining computation of the task
* @return
*/
public double getRemainingDuration() {
- Process.ifInterruptedStop();
return MsgNative.taskGetRemainingDuration(this);
}
/**
* This method sets the priority of the computation of the task.
- * The priority doesn't affect the transfert rate. For example a
+ * The priority doesn't affect the transfer rate. For example a
* priority of 2 will make the task receive two times more cpu than
* the other ones.
*
* @param priority The new priority of the task.
*/
public void setPriority(double priority) {
- Process.ifInterruptedStop();
MsgNative.taskSetPriority(this, priority);
}
/* * * *
* @throws TaskCancelledException
*/
public void execute() throws HostFailureException,TaskCancelledException {
- Process.ifInterruptedStop();
MsgNative.taskExecute(this);
}
/**
*
*/
public void cancel() {
- Process.ifInterruptedStop();
MsgNative.taskCancel(this);
}
/** Deletes a task.
* @exception NativeException if the destruction failed.
*/
protected void finalize() throws NativeException {
- Process.ifInterruptedStop();
if (this.bind != 0)
MsgNative.taskDestroy(this);
}
+
+ /** Send the task asynchronously on the mailbox identified by the specified name,
+ * with no way to retrieve whether the communication succeeded or not
+ *
+ */
+ public void dsend(String mailbox) {
+ MsgNative.taskDSend(mailbox, this);
+ }
+
/**
* Sends the task on the mailbox identified by the specified name
*
* @throws TransferFailureException
*/
public void send(String mailbox) throws TransferFailureException, HostFailureException, TimeoutException {
- Process.ifInterruptedStop();
MsgNative.taskSend(mailbox, this, -1);
}
* @throws TransferFailureException
*/
public void send(String mailbox, double timeout) throws NativeException, TransferFailureException, HostFailureException, TimeoutException {
- Process.ifInterruptedStop();
MsgNative.taskSend(mailbox, this, timeout);
}
* @throws TimeoutException
*/
public void sendBounded(String alias, double maxrate) throws TransferFailureException, HostFailureException, TimeoutException {
- Process.ifInterruptedStop();
MsgNative.taskSendBounded(alias, this, maxrate);
}
-
+ /**
+ * Sends the task on the mailbox asynchronously
+ */
+ public native Comm isend(String mailbox);
+
+ /**
+ * Starts listening for receiving a task from an asynchronous communication
+ * @param mailbox
+ * @return
+ */
+ public static native Comm irecv(String mailbox);
/**
* Retrieves next task from the mailbox identified by the specified name
*
*/
public static Task receive(String mailbox) throws TransferFailureException, HostFailureException, TimeoutException {
- Process.ifInterruptedStop();
return MsgNative.taskReceive(mailbox, -1.0, null);
}
* @throws TimeoutException
*/
public static Task receive(String mailbox, double timeout) throws TransferFailureException, HostFailureException, TimeoutException {
- Process.ifInterruptedStop();
return MsgNative.taskReceive(mailbox, timeout, null);
}
*/
public static Task receive(String mailbox, Host host) throws TransferFailureException, HostFailureException, TimeoutException {
- Process.ifInterruptedStop();
return MsgNative.taskReceive(mailbox, -1.0, host);
}
* @throws TimeoutException
*/
public static Task receive(String mailbox, double timeout, Host host) throws TransferFailureException, HostFailureException, TimeoutException {
- Process.ifInterruptedStop();
return MsgNative.taskReceive(mailbox, timeout, host);
}
* @return
*/
public static int listenFrom(String mailbox) {
- Process.ifInterruptedStop();
return MsgNative.taskListenFrom(mailbox);
}
/**
* @return
*/
public static boolean listen(String mailbox) {
- Process.ifInterruptedStop();
return MsgNative.taskListen(mailbox);
}
* @return
*/
public static int listenFromHost(String alias, Host host) {
- Process.ifInterruptedStop();
return MsgNative.taskListenFromHost(alias, host);
}
}