On Tue, 2009-11-17 at 10:29 -0500, Steve Huston wrote:
> Hi Aaron,
> 
> > -----Original Message-----
> > From: Aaron Hillegass [mailto:[email protected]] 
> > Sent: Tuesday, November 17, 2009 9:56 AM
> > To: [email protected]
> > Subject: Re: qpid: Thread-local storage on Mac?
> > 
> > 
> > On 2009/11/17, at 14:18, Andrew Stitcher wrote:
> > 
> > > The big job which you clearly haven't got to in your compiles yet
> is
> > > porting the Poller implementation. Currently there are 2 
> > ports for the
> > > Poller epoll for Linux and ecf for Solaris - the Solaris port is
> > > currently broken.
> > >
> > > I'm not sure which poll primitives are available on Darwin 
> > > - if you're lucky you might have a version of kqueue to use.
> > 
> > Yes, we have kqueue:
> >     
> > http://developer.apple.com/Mac/library/documentation/Darwin/Re
> ference/ManPages/man2/kqueue.2.html
> 
> That's good... You have the facilities available to work this, but you
> have a few weeks' worth of work ahead. I've seen your other email as
> well and it seems like you need to work on:
> 
> 1. Poller, using kqueue. You can probably leverage a lot of the epoll
> code; at least the way it enables and disables handles and senses
> events.
> 2. TSS - you may be able to get away with not using it, if all you
> need is the client. You'll probably be writing a Mac version of
> AsynchIO.cpp - just don't carry over the TSS variables from the posix
> version. If you do encounter a need to transition to run-time TSS
> you'll need to add a bit if restructuring there as well.
> 3. #includes - rather than #include <sys/types.h> everywhere, make the
> needed adjustments to qpid/sys/IntegerTypes.h

Given that the OSX userspace is mostly BSD I'd expect that point 3.
should work pretty much the same as on Solaris and Linux (ie not very
much to change here, but any changes are in the way of a few missing
#include lines because of implied header -> header in Linux not present
elsewhere).

Point 2. is more problematic as it's counter productive to split the
various POSIX based ports into different files unless really necessary.
In this case any solution using an encapsulated
pthread_getspecific/pthread_setspecific will work on all Posix
platforms.

There are places where thread specific variables are essential - in the
implementation of the Linux EpollPoller for example - and any kqueues
based port will inherit this need as well.

However as Gordon notes the AsyncIO uses of thread based variables are
more suspect in their necessity and should be revisited anyway.

Andrew



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to