Jose wrote:
@MskoDestny
"Why can't the receiver of the message just be another thread within the same process?"
Because I'd like library usage to be as simple as calling any other function, without the need to create a message port, receive it's messages, processing them, and clean up everything in the end.
I'm not sure I follow. In both cases there is need for setup and cleanup. With a separate process you need to spawn the separate process and allocate a shared memory area. The user of the library will need to stick his buffers in the shared memory area if you want to avoid copying it. When you're done with the library the extra process needs to be closed and the shared memory freed.
With a separate thread, you need to spawn the thread and setup the mechanism by which you're going to send messages to it. There are no special memory allocation requirements put on the user of the library. When you're done you kill the thread and clean up your message mechanism.
Also, I don't see why you need a full OS message port. Just write a really simple message queue using some simple data structure (linked list perhaps) and a mutex to control access.
Of course, I should say I know next to nothing about programming on Amiga OS so perhaps I'm missing something here.