executing stream: should it be a new concept?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
lemonyii
Member
Member
Posts: 153
Joined: Thu Mar 25, 2010 11:28 pm
Location: China

executing stream: should it be a new concept?

Post by lemonyii »

hi guys!
days after days, i've been always found my kernel architecture not good enough. but sparks flies these days.

i've been thinking a new thing for kernel, executing stream, which was designed for asynchronous syscalls and higher core performance, will be much lighter-weight than thread, since threads need to setup signal handlers, flags, and attributes so on. And even thread share linear space with other threads within a same process, it have to switch space on scheduling.

what is it like:
1. quick creation and destroy, with limited array with about 1024 elements or so.
2. with only GPREGs, maybe float regs, and ip saved, so a quick switch is ensured.
3. then thread is implemented in a higher level in kernel, and could be as complex as LWP.
4. and message to kernel could be replaced by direct syscalls and we can create executing stream for each stream, avoiding the overhead by message and implementing asynchronous syscalls.
5. every interrupt will create executing stream like syscalls, each executing stream can create a new one when need other kernel modulars, rather than call another part directly( asynchronous might be needed ) or send a message( a bit slow ).

but there are really many problems:
1. it could make kernel much more complex and unstable
2. the function provided might be not enough for a nice run.
3. i havent think clear how it works to handle the interrupt and syscalls
4. i dont know if the benefit metioned before is as i thought to be there
5. the kernel may have to work very differently as my before one, new layer, new relationship and new mechanism

the key point is, much faster switch, much better kernel performance, and asynchronous syscalls;
the risk is, i may waste a lot time like a month and such architecture turn out to be of none use, little performance improving but more complexity and less functional.

i'm hesitating and wish you can figure it out.
thanks!
Enjoy my life!------A fish with a tattooed retina
User avatar
qw
Member
Member
Posts: 792
Joined: Mon Jan 26, 2009 2:48 am

Re: executing stream: should it be a new concept?

Post by qw »

Perhaps fibers are what you are looking for.
User avatar
lemonyii
Member
Member
Posts: 153
Joined: Thu Mar 25, 2010 11:28 pm
Location: China

Re: executing stream: should it be a new concept?

Post by lemonyii »

i'm still thinking.
i read the wiki about fiber, they are really familiar.
the key difference is, the fiber metioned in wiki have to give up the execution itself, but my idea is to be interrupted like thread.
and now i'm really worried about how much benefit it could really be.
Enjoy my life!------A fish with a tattooed retina
Post Reply