Difference between revisions of "Architecture/Proposal/Advanced Threading-Architecture"
From Apache OpenOffice Wiki
(Simplfied wiki code.) |
m (Added category.) |
||
| Line 43: | Line 43: | ||
Graphical overview:<br> | Graphical overview:<br> | ||
[[Image:Spec_Architecture_Threading_Advanced.jpg]] | [[Image:Spec_Architecture_Threading_Advanced.jpg]] | ||
| + | |||
| + | [[Category:Spec:Architecture:Threading]] | ||
Revision as of 11:32, 9 May 2006
state: sketch
Concept: A purely event driven [threading] architecture, including asynchronous process related signals, I/O and window messages.
- Pros
- Not calling blocking system calls leads to 'short' lasting mutex acquisitions.
- No hand crafted reschedules necessary anymore.
- Easy utilization of Hyper Threading, multi cores and SMP.
- Controlable CPU utilization and possible avoidance of over utilization.
- 'Simple' architecture.
- One single location where to create threads.
- Cons
- (assumed to be) Hard to implement.
Pseudo Code for event loop:
void dispatch(int signal) {
switch(signal) {
case SIGIO:
fileHandler(getHandle());
break;
case SIGTERM:
...
}
}
int quit;
sigset_t sigset;
int main(void) {
int signal;
while(!quit) {
sigwait(&sigset, &signal);
dispatch(signal);
}
return 0;
}
