bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Message passing in user-land


From: Niels Möller
Subject: Re: Message passing in user-land
Date: 16 Jul 2002 22:58:40 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

rreale@iol.it writes:

> I'll try to roughly explain my idea, which doesn't apply
> to every IPC type, but only to a small subset thereof. This 
> subset includes the message passing between a client/server
> pair and among the servers themselves, with the additional
> constraint of very small pieces of data being passed at once.

I think the problem is that you have some memory shared between
threads (of different processes). For now, I'm assuming that this
sharing is setup in advance by some memory manager or kernel
mechanism.

But as several threads need to access the memory in parallell, you
need to use some syncronization primitives (mutexes, condition
variables, see any book on programming with threads) to coordinate
access. And as far as I can see, that's hard to do without kernel help.

One basic problem is: I'm an idle server process, and I want to wait
for a client to send me a message. How do I do that? There are two
ways: Either I poll the structures regularly, or I need some basic ipc
primitive, typically a wakeup call to a thread in a different process.
In the former case, I'll either waste cpu time or get slow ipc
response time, and for the latter case, it seems hard to do it
completely in user space.

So to give a good answer I think one first need a thourough
understanding of how how threading primitives like mutexes and
condition variables are implemented, and that's not really my area.

/Niels



reply via email to

[Prev in Thread] Current Thread [Next in Thread]