On Fri, Aug 3, 2012 at 9:45 PM, Business <[email protected]> wrote:
> On August 1, 2012 8:55:59 AM David Korn <[email protected]> wrote:
[snip]
> > Can you give us an idea what you will be doing with threads in ksh93v?

Grumpf... this is difficult to say. The main problem is that we need a
way that I can sit down with David&&Glenn and do some planning and
design... the real coding phase is IMO less than three weeks maximum
to come up with a working prototype... and from that point on we need
to drive out the bugs.

Note that (to calm down concerns about "overhead") ... thread support
simply means we need to have full control over all global resources
(e.g. global variables, file handles etc.) and have them protected.
Beyond that it looks like this:
1. We need to reach a point where we have |Shell_t
*sh_shell_create(int flags, int ac, char *av[], ...)| and
|sh_destroy(Shell_t*,int flags, ...);|| and can use multiple
_INDEPENDENT_(!!) shell objects concurrently.
This is the major part and requires some code shuffeling and more or
less takes two weeks.
2. 2nd part is to create a "pthread_create" shell builtin to create a
thread which calls a shell function. Leaving the shell function quits
the thread.
3. Add r/w-mutexes where required.
4. Test the mess.

Note that this is not magic nor does it (beyond the "pthread_create"
builtin... which I estimate to be around 50-60kb of code on AMD64
(including the builtin _ast_getopts man page)) consume massive
resources, code space or cause major slowdowns... it's more or less a
clever reorganisation of the code that it fits the requirements of
threads.

----

Bye,
Roland

P.S.: Before that nasty discussion comes up: NO, thread-local
variables will NOT help. Basically they prevent that resources can be
moved from one thread to another and that causes _major_ problems in
the later implementation stages.
-- 
  __ .  . __
 (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

Reply via email to