Multithreaded Bash

Avoiding leaks

Comments are moderated. It may take a few minutes before your comment appears.
Markdown is supported in your comments.

Background: there is a function rpc_thread(). It uses curl to send a request to the AUR. It parses the reply and might echo a line and touch a temp file (named $temp). We need to call this function a lot. Waiting for a reply takes between 100 and 300 ms. With several hundred requests, prodding the AUR takes a full minute.
$packages contains a list of strings, each one to be processed in parallel

Name:
Mail: (not shown)

Please type this: