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: Tue, 19 Dec 2000 18:52:49 +0100 (MET)

> ps. If I have missunderstood what you are aiming at, please ignore this
> message.

No I cant ignore such interesting message ;)

> ps2. I really hope that this didn't sound rude, I'm just in a good mode
> today. :)

I know..

> ps3. If you find a solution to this problem, please tell me. I AM
> interested!

Well... this is as you explain very well quite dificult to implement at
the compiler level.. but I know threading **as is today** cant be the
ultimate response.. so we must aim to have something better..

As a first step:
What about designing a hurd server... something we could call
a **thread-server**?..

struct myobject *this; 
struct myobject *another;

this = new_object (...);
another = new_object (...);

thread_variable (this); /* just call the hurd thread-server */
thread_variable (another);

/* the thread sever storage the object and add all the information needed
to syncronize  */

int do1_something (struct myobject *this)
{
        /* code */
}
int do2_something (...the same..)
{

}

int do3_something (struct myobject *a, struct myobject *b)
{

}
thread_function (do_something); 
thread_function (do1_someting);
thread_function (do2_something);
thread_function (do3_something);

call_thread (do3_something, this, another);
call_thread (do_something, this);
call_thread (do1_something, another);

And all the magic in the server....

the object can have a queue of tasks treating to access it... the server
just consumes this queue in some intelligent way, based upon information
added to the object in order to be thread-safe, creating threads if it 
can or just jumping to another task if something is too slow..

Well I know this is not serious.. ;) but it could be..

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]