diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2021-08-21 18:06:52 +0200 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2021-08-21 18:06:52 +0200 |
| commit | 54652db0079945faf378f949fb45914eb629eb8d (patch) | |
| tree | a353c96376d80fadd85164b4ad2d8b463669aeeb | |
| parent | 5808757a6cd091ede4a3633c0f175d2a412b0c23 (diff) | |
Minor changes
| -rw-r--r-- | README.md | 2 | ||||
| -rwxr-xr-x | pool.sh | 10 |
2 files changed, 7 insertions, 5 deletions
@@ -13,4 +13,4 @@ - Properties can be retrieve with `./pool.sh getp <poolname> <procid> <propname>` - Finally, all the processes output file can be retrieve with `./pool.sh ls <poolname>` -**Finale quote:** No checks are performed on the pool.sh arguments. Be sure to use the right ones. +**Finale quote:** No checks are performed on the pool.sh arguments. Be sure to use the right ones. Defaults configuration requires access to the `/tmp` directory. @@ -58,7 +58,7 @@ create() { } remove() { - refresh + refresh # Refresh process status and load status [ $nproc -gt 0 ] && abort "Processes are still running in the pool!" rm -rf "$pool" } @@ -80,11 +80,13 @@ refresh() { run() { refresh + # Wait for room in the pool while [ $nproc -ge $maxproc ] do sleep $REFRESH_EVERY refresh done + # Create new process nproc=$(( nproc + 1 )) procid=$(( lastprocid + 1 )) lastprocid=$procid @@ -92,9 +94,9 @@ run() { $PROC_CMD > "$pool/out_$procid" & procpid=$! [ -z "$procs" ] && procs="$procpid" || procs="$procs $procpid" - write_status - write_process - echo $procid + write_status # Update status + write_process # Create process properties + echo $procid # Return process id } cat_output() { |
