Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: multi threaded script
- X-seq: zsh-users 14524
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Joke de Buhr <joke.de.buhr@xxxxxxxxx>
- Subject: Re: multi threaded script
- Date: Tue, 3 Nov 2009 21:42:25 +0100
- Cc: zsh-users@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=g9bEGA1jcKwbaC+1GMmyeF1GGpDXbcmDd5i38j3TkTU=; b=vkp9A+mz34Ldzq8nS6CFjP1YxqQ6xtEdXBrQ90ZPVup8hVHuUlxF+Vhj94lmsipEzS 4kyipHubVMrBlqbkR6HPk39+qzo2E7Y7KA/MquNwvvYrD3jPOo8tlgmPkRNIzNwfoaix +W7uH6DRUagHj1RQ53VmuDGlXAs2kfjhV82bM=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=qmGZeALfHBz+RZNT32sbe4JgrTUNEfIOB+UW/AK1BIJax7FjOyZQAkXUnJLfOmuUiB sBDvbf8s/R1A2JTBt+sbyz23nhGcK9Q3Vascr+/0f0FvP89xGefepnQWZI0gPmIvFoNK XQdL8/WML4+WJeBU/mVDEE3/4IyoxbyGV/KMY=
- In-reply-to: <200911032052.11987.joke.de.buhr@xxxxxxxxx>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <ed7b1c610911030834r383be469u2f0674311d697202@xxxxxxxxxxxxxx> <200911032052.11987.joke.de.buhr@xxxxxxxxx>
2009/11/3 Joke de Buhr <joke.de.buhr@xxxxxxxxx>:
> On Tuesday 03 November 2009 17:34:57 Baptiste Daroussin wrote:
>> Hi,
>>
>> I wanted to write a script that needs to be multithreaded, for example
>> an UI in zsh/curses that does things in background while the UI is
>> still responsive.
>
> It's possible to do background tasks in subshells. Simple append an & to
> the end of the subshell list:
>
> print "hi_0"; { print "hi_1"; sleep 60; print "hi_2"} & print "hi_3"; \
> sleep 20; print "hi_4"
>
>
> Somewhere on the internet there is an example in bash of how to setup a
> multiprocess shell program which uses subshells as worker processes. The
> communication between these processes is done via named pipes. It's much
> like Apache's worker process model.
http://lwn.net/Articles/309682/
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author