Top
Back: vdim
Forward: waitfirst
FastBack: Functions and system variables
FastForward: Control structures
Up: Functions
Top: Singular Manual
Contents: Table of Contents
Index: Index
About: About this document

5.1.153 waitall

Syntax:
waitall ( list_expression ) waitall ( list_expression , int_expression )
Type:
none/int
Purpose:
Expects a list of open ssi links of mode fork or tcp and waits until all of them are finished, i.e., are ready to be read.
In the first case, the command waits for all links to finish (and may therefore run forever), and does not return anything.
In the second case, a timeout in milliseconds can be provided, forcing the command to terminate after the specified time (return value = 0), or - in case this happens earlier - when all links are finished (return value = 1).
Example:
 
  link l1 = "ssi:fork"; open(l1);
  link l2 = "ssi:fork"; open(l2);
  link l3 = "ssi:fork"; open(l3);
  list l = list(l1,l2,l3);
  write(l1, quote(system("sh", "sleep 15")));
  write(l2, quote(system("sh", "sleep 10")));
  write(l3, quote(system("sh", "sleep 11")));
  waitall(l, 5000); // terminates after 5sec with result 0
==> 0
  waitall(l);       // terminates after 10 more sec
  close(l1);
  close(l2);
  close(l3);
See waitfirst.

Top Back: vdim Forward: waitfirst FastBack: Functions and system variables FastForward: Control structures Up: Functions Top: Singular Manual Contents: Table of Contents Index: Index About: About this document
            User manual for Singular version 3-1-2, Oct 2010, generated by texi2html.