Unbuffered Message Passing in Microkernel.

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
virusx

Unbuffered Message Passing in Microkernel.

Post by virusx »

hi all,

I am working on microkernel. I want to use unbuffered message passing. Can anybody suggest me how to implement that?
For now, i copied message from client to kernel and then from kernel to server. But i dont how to implement unbuffered meggage passing.
I have read that L4 and QNX is using unbuffered message passing. But i have no idea how to implement it.
In my address space, 0-3.5GB is USER process and 3.5 GB to 4GB is kernel.

thanks in advance
Legend

Re:Unbuffered Message Passing in Microkernel.

Post by Legend »

You might try to map pages on the fly instead of copying twice.
Gnome

Re:Unbuffered Message Passing in Microkernel.

Post by Gnome »

One way I see, is to have each a region in each process's address space for a kind of shared memory that hold the messages. So, when another process sends a message, it shares the page containing the message between the sender and the recipient, and delivers the message. Now, to truly do this without queueing, you would have to do a context switch here to the recipient (in a new thread) and invoke a callback to handle the message.

If you don't mind having a queue in the kernel, what I would say is to defer the context switch until the process would normally get the CPU, and complete the delivery of the messages then.

One problem with this (using either method of delivery) is that it forces the application developer to have to deal with threading issues, because the message handler may be invoked at any time.
virusx

Re:Unbuffered Message Passing in Microkernel.

Post by virusx »

Legend wrote: You might try to map pages on the fly instead of copying twice.
Yes, I am doing that for messages larger than 4k(1 page).
Is it feseable for say 50 bytes message?

Will it be better than memory transfer?

I am looking for a memory to memory transfer.
One way I see, is to have each a region in each process's address space for a kind of shared memory that hold the messages. So, when another process sends a message, it shares the page containing the message between the sender and the recipient, and delivers the message. Now, to truly do this without queueing, you would have to do a context switch here to the recipient (in a new thread) and invoke a callback to handle the message.
Thanks for that idea but i think it is difficult to implement and would be slower than memory transfer and mmap (More Pain Less gain).

thanks
Post Reply