This is the mail archive of the cygwin-developers mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Jemalloc under CYGWIN


On Oct 21 21:49, Yucong Sun wrote:
> > What exactly is the malloc problem you're seeing?
> 
> The specific problem I'm having is that jemalloc's malloc_init() calls
> needs to use pthread_mutex_init()  or even pthread_mutex with a
> initializer.   Both in-turn uses malloc, triggering this issue.
> 
> A quick fix would be somehow make pthread always use system
> malloc/free, which shouldn't be that bad.

What about using a native critical section instead?  It shouldn't be too
tricky to conditionalize this in jemalloc.

> Another issue I saw is that jemalloc will use readlink()  for
> "/etc/jemalloc.conf" during malloc_init(), which on cygwin, this
> function uses "new" to do some path manipulating work, which also have
> the same issue.  However, we can probably just disable that .

Or alternatively the file can be reasd like the other files in /etc
Cygwin needs early access to.  See the NT_readline class and an
example usage in, e.g, mount_info::from_fstab.

> So, the quickest fix would be to make cygwin's thread implementations
> always use system malloc.
> 
> some small workarounds in jemalloc would be needed afterwards, but it
> should be a nice starting point.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

Attachment: pgpm8baKB0zab.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]