Conrad,
Thanks for your suggestions regarding shared memory. In my current
implementation
I do exactly that: use shmget / shmat / shmdt.
The problem here is that there are typically many clients (Task A's) are
sending requests
to their corresponding server (Task B). This means that the server task has
two
choices in regards to memory attachment:
a) Get / attach to each of the client tasks shared memory at startup
and keep them
attached;
b) Get / attach and then detach around each send request.
I have found that calls to shmget / shmat are quite expensive in terms of
overhead, so
I don't want to be doing this on each request. On the other hand, if I keep
each
attachment open, then the system can end up with several hundred shared
memory
segments open.
I would still be keen to know whether or not it is possible to transfer data
between
two tasks in user space without having to use shared memory.
Thanks again.
Andrew
> On Wed, Apr 25, 2001 at 08:06:01PM +1000, Andrew Eager wrote:
> > Can a kernel module copy data from one user space to another user space
?
> >
> > ( I want to be able to send a essage from one task to the other with
only one memory copy.
> > ie copy directly from Task A's memory space to Task B's memory space.)
>
> you can use shared memory segments for this (zero copy): shmget(2) etc.
You
> shouldn't need a kernel module for just this.
>
> > I can live with the client tasks allocating their send/receive memory on
a non-swappable basis (can't remember how but I know it can be done in
user-space).
>
> yep, use mlock(2)
>
> Conrad.
--
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://slug.org.au/lists/listinfo/slug