Ok, so I was thinking about how context switching is probably the most expensive thign that is commonly done...(aside from task switching)
so, I was thinking...
what if each time a system call was done by a process, if it was added to a stack/list.... then, a process switch is done, and if another system call is doen, then add it to the list and switch processes, and when the current process is waiting on a system call, just do all the system calls in the stack, therefore making it cause only one context switch and such for that...
anyone kind of understand what I mean?
Pipelining system calls?
I get the idea, i think but who maintains the stack/list. i mean how can process 1 or process 2 add to a shared stack/list. Via a system call ? that would require a context switch anyways rendering the idea useless. how ever you could pipe systemcalls in a single process/thread. If a process would need to do more then one systemcall though i can't think of a situation yet.
Author of COBOS
consider the following:JamesM wrote:But when a process issues a system call it is then destined to wait until that syscall has finished (it can't do anything else until!) so in effect anything that 'queues' or 'delays' syscalls is going to affect latency adversely.
i want to map virtual memory segments say for instance 2 MiB to several locations in memory. (is the case with PlayStation memory shadowed at other addresses)
Code: Select all
char buffer[2*1024*1024];
vmap_user(0x00000000, buffer, sizeof(buffer));
vmap_user(0x80000000, buffer, sizeof(buffer));
vmap_user(0xA0000000, buffer, sizeof(buffer));
Author of COBOS
In micro kernel the L4 set the standard going from asynchronous to synchronous which btw gave an enormous speed increase. So i am very reluctant to make asynchronous again. But for monolithic kernels it might work.
Author of COBOS
Simple.
Instead of passing single parameters and returning instantly, instead pass a stack, and loop until it's empty. (pass an array on the stack and loop through it?)
You can try using RBP-RSP as an indicator, or JECXZ or whatever suits ya.
System calls are expensive enough to write everything as a loop over arguments if one in 10 calls you pass 2 sets of arguments.
Or so.
Instead of passing single parameters and returning instantly, instead pass a stack, and loop until it's empty. (pass an array on the stack and loop through it?)
You can try using RBP-RSP as an indicator, or JECXZ or whatever suits ya.
System calls are expensive enough to write everything as a loop over arguments if one in 10 calls you pass 2 sets of arguments.
Or so.
There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies.
- C. A. R. Hoare
- C. A. R. Hoare