On Fri, 2 Feb 2007, Martin Englund wrote:
I'm working on a command line tool that communicates with a daemon, using
libdoor(3LIB), to retrieve events (malloc()ed structs of variable length) which
sit on a ring buffer.
My problem is that once I've picked up an event from the ring buffer I want to
free() it, but I can't do that until I've called door_return(), but once I've
called door_return() I'm no longer executing in the server process.
I don't want to do a second door_call() just to free() the event, but I see no
other way to solve the problem.
I am thankful for hints of other ways to solve this...
Multithreaded programming.
Create a "garbage collector thread" in the door server, pass the "to be
freed" buffer onto that before you return. I.e. free asynchronously.
FrankH.
cheers,
/Martin
This message posted from opensolaris.org
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code