help-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Threads


From: Roberto Diaz
Subject: Re: Threads
Date: Fri, 15 Dec 2000 12:05:09 +0100 (MET)

> Hi Nasos
>  The hurd uses cthreads at this time. There are plans to implement pthreads
> but that is at some time in the future.

Can somebody tell me what is the need to keep having that abstraction?

Why do we really need threads?

For expample.. 

1.-In a single-proccesor machine... What's the point to have
threads instead of a single process with event driven I/O and the
same non-blocking facilities for other blocking task?

2.-In a multi-proccesor machine... wouldn't be better to have all the
thread abstraction managed by some hurd server instead of the
programmer.. so I can write things like this:

        struct object *myobject;
        int rst1, rst2, rst;
        
        myobject = new_object ();

        rst =  __thread__ fgetc (stdin); /* if possible use event driven I/O */
        rst1 = __thread__ do_something (&object);
        rst2 = __thread__ do_something_else (&object);

        rst += myfunction (rst1 + rst2, &object);

Here "__thread__" could have a similar meaning like "register" something
non-mandatory. Just "try to put this code in another proccesor if we
have another one available, if we haven't just put the first task in the
proccesor, don't block if possible and expect for an I/O event!!".

Lets suppose this functions where good candidates for
multi-threading.. wouldn't be wonderful to have the compiler adding some
marks to the function so that some hurd server could manage the
rest... (Locks, put the code in several cpu's etc?)...

Wouldn't be a very good thing to have this managed by the servers/compiler
instead the programmer?

I would like to start a discussion about this.. so please let me know your
reasons to keep maintaining that nasty thing called "Threads"..

If you (and I **mean you** because every time I ask you for some work in
order to develop the hurd servers more quickly than now, nobody answers
me) are going to maintain that doubtful dogma I would like to know
your real reasons.. one by one.. please.
 

Regards

Roberto

------------------------------------------------------------------------
Roberto Diaz <rdiazmartin@vivaldi.dtts.net>
http://vivaldi.dtts.net 
Powered by ddt dynamic DNS
Powered by GNU running on a Linux kernel.
Powered by Debian (The real wonder)

Concerto Grosso Op. 3/8 A minor
Antonio Vivaldi (so... do you need beautiful words?)
------------------------------------------------------------------------




reply via email to

[Prev in Thread] Current Thread [Next in Thread]