Best way to share data between threads

Giorgos Keramidas keramida at ceid.upatras.gr
Tue Feb 22 06:39:44 GMT 2005


On 2005-02-22 05:50, Jonathon McKitrick <jcm at FreeBSD-uk.eu.org> wrote:
>
> Hi all,
> I'm porting some libraries from Win32 to BSD/Linux.  In the original
> code, I receive a Windows event with an attached COM object.
>
> Under *nix, what is the best way to copy this?  A message, followed
> by accessing shared memory between threads?

Does the message really have to be shared across many threads?  I'm
only asking because thread-specific message queues are not that hard
to build with pthreads.  You will only need a per-thread queue to hold
messages and a master thread that 'dispatches' messages to the proper
thread/queue.



More information about the freebsd-questions mailing list