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.
I was wondering what is a common way to implement it? It might be useful for example while communicating with a text mode GUI (yea, that's my great idea ))
1. Use an os service were the first process calls an os software interrupt with a message to save in an 'inbox' messaging system. The target task when executing then checks this inbox for any messages addressed to it.
2. The first task places its messages on a stack, then requests the os to switch tasks to the second task, which when executed pops the messages off the same stack.
I can't think of any other ways. Try reading some osdev theory books.
You could use a shared section of memory in combination with a message queue.
Process 1 asks the OS for a block of shared memory.
Process 1 places the data in shared memory.
Process 1 then sends a message to process 2 saying it has data waiting.
Process 2 gets the message and uses the data.
Process 2 sends a reply to process 1
Process 1 tells the OS to free the memory.
The advantage to this is that if you are using paging you can map the memory to the same logical location in both processes. That gives you the ability to simply pass a pointer in the message and both processes can resolve the address to the correct physical memory location.