Andrew Clarke wrote:
> On Thu, 09 Oct 2008 00:36, I. Szczesniak wrote:
> > On 9/29/08, David Korn <[EMAIL PROTECTED]> wrote:
> > > Subject: Re: ksh93t and version numbering (Was Re: [ast-users] ksh93t
> > > 2008-09-26 beta src) If I make a version that works with multiple
> > > threads, then it would become a new version like 'u'.
> >
> > Supporting multiple threads would be a feature which would be greatly
> > appreciated.
> >
>
> Ummmm, that's called "pipelines" and "co-processes" isn't it?
No, that are seperate "processes". The idea David was talking about is
to allow multiple execution threads in one process - the threads all
share the shell's global variables but have private local variables
which they can use for parallel processing.
For example:
$ sh -c 'function mythr { sleep 100 ; } ; builtin pthread_create ;
integer tid ; pthread_create -L -f mythr -t tid ; wait -T ${tid} ; exit
0' #
There are some subtle semantic issues with subshells, for example that
if a subshell instance has multiple threads we _must_ call |fork()| when
entering another subshell to prevent that changes to the environment
(cwd, |setlocale()| etc.) affect other threads in the parent subshell
instance but the remaining changes are plain janitor-style work (for
example by replacing the accesses to the |Shell_t| structure from a
global |sh| variable to |shp| pointers, putting global variables into a
seperate variable pool, give threads their own "local" variable pool and
minor other changes. It's not very hard to implement, just lots of
work).
----
Bye,
Roland
--
__ . . __
(o.\ \/ /.o) [EMAIL PROTECTED]
\__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer
/O /==\ O\ TEL +49 641 3992797
(;O/ \/ \O;)
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users