Idea:IPC: Software interrupts
Posted: Mon Jan 09, 2012 3:57 pm
Hi,
I'm redesigning my taskmanager and I wanted to add a feature that my old manager didn't have: Inter Process Communication. To be honest I haven't read allot of articles on that subject yet, but I've been thinking about simple ways to make it work myself. I came up with the following system of using software interrupts, custom handlers and shared memory:
=>I'm also wondering if this would work nicely on SMP architecture, (haven't read allot on that either) or if I should adapt it to make it work.
I'm redesigning my taskmanager and I wanted to add a feature that my old manager didn't have: Inter Process Communication. To be honest I haven't read allot of articles on that subject yet, but I've been thinking about simple ways to make it work myself. I came up with the following system of using software interrupts, custom handlers and shared memory:
=>My question what do you think about my idea?Good?Bad? Or would you like to add something? What are the cons of this idea?When a process wishes to pass a message: it puts it's process ID and thread ID in eax and ebx and the physical address of it's message in ecx and preforms a software interrupt.
The handler gets called, reads eax, ebx and ecx (and wakes the waiting thread) and adds those values in the process's message box.
The process or thread maps the physical memory and reads it, unmaps the address, and then it confirms the message by doing another software interrupt.
The original process deletes the message and frees the physical page.
A process can be put to sleep if its waiting for a message a be woken when it arrives, or can constantly check his message box.
=>I'm also wondering if this would work nicely on SMP architecture, (haven't read allot on that either) or if I should adapt it to make it work.