[Mono-list] pthreads in mono

Chris Howie cdhowie at gmail.com
Thu Apr 3 13:22:30 EDT 2008


On Fri, Mar 28, 2008 at 1:21 PM, Paolo Molaro <lupus at ximian.com> wrote:
> On 03/28/08 Chris Howie wrote:
>  > Note that it's not that simple though.  The signature specifies a
>  > pthread_t*, not a pthead_t**.  It wants a pointer to a structure that
>  > will be filled in, not a pointer to a pointer (as is IntPtr&).  The
>  > code as writted above will certainly corrupt the memory next to the
>  > location that the "handler" local is stored in, unless
>  > sizeof(pthread_t) is <= IntPtr.Size.
>
>  Sure and my code is correct and won't generate any memory corruption
>  because all the sane operating systems have pthread_t as an integer or a
>  pointer. You're free to look for an operating system where the above is
>  incorrect. When you have found it (you might need to write you own, as
>  even OSX got this bit right...) you will have to port mono to it first.

Ah, I was not aware of this so I was trying to make sure all of the
bases were covered.

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers


More information about the Mono-list mailing list