[cfe-dev] [libc++] Porting libc++ to Windows

David Chisnall David.Chisnall at cl.cam.ac.uk
Thu Jul 2 02:25:57 PDT 2015


On 2 Jul 2015, at 10:19, Fulvio Esposito <fulvio.esposito at live.it> wrote:
> 
> I like your idea and am willing to give it a try. In this case I think it would be more helpful to first define the thin wrapper around pthread and reimplement std:: stuff on top of that, and then to provide the Win32 implementation. How does it sound? 

Yes, that’s what I’d do: first factor out all of the pthread-using stuff into a support/pthread (or similar) file that exposes the pthread functionality via some generic name, and then implement the same with win32 threads.  When you do the second part, don’t be afraid to go back and modify what the abstraction layer looks like if there are some idioms that are hard to support with win32 threads but easy with pthreads (or vice versa).

You may end up finding that the abstraction layer really looks like the C++ standard library, in which case you may end up just having a using directive in the std namespace for the platform-specific implementation of some classes (mutex comes to mind - thread may have some implementation shared between platforms).

Please feel free to sign me up as a reviewer,

David





More information about the cfe-dev mailing list