X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:date:from:to:subject:message-id:reply-to
	:references:mime-version:content-type:in-reply-to; q=dns; s=
	default; b=J1IEnX+H/tnp6A+ncxDWA6igUvzXMW0B1yMUwIBLwkhC+3JbQEWiB
	yACGnYcrlEhhVBrRIL3sdd7gOG3C0c0lCvQdLPxIg0e2ZEEfpvcynkSMsxjjXwcJ
	V5v4duU6ceP23lyb8xdfoL02O+E30B3pSFP+4KvK1kHWyHb4Jp+xXU=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:date:from:to:subject:message-id:reply-to
	:references:mime-version:content-type:in-reply-to; s=default;
	 bh=x6jyIYo5uHcLIW/5HiUCLbbowB0=; b=lJMwl4oUdD/NKYM7eg1UUFi9hllt
	j90He9MJneFm6FfqSloVDL8KjesxXyIHIV+6i/HMoFtZHkspgkx1vvMEY9gV8gc3
	zUe8EcQVvfK5rklGZfpXX/emWVoRNuTfnLL4DguypdQ5kLVtkJlvTxVLBdajXDUo
	+53kGlBMa6XRwXQ=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-5.4 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2
X-Spam-User: qpsmtpd, 2 recipients
X-HELO: calimero.vinschen.de
Date: Wed, 21 Oct 2015 17:40:21 +0200
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com, cygwin-developers@cygwin.com
Subject: Re: Jemalloc under CYGWIN
Message-ID: <20151021154021.GA19868@calimero.vinschen.de>
Reply-To: cygwin-developers@cygwin.com
Mail-Followup-To: cygwin@cygwin.com, cygwin-developers@cygwin.com
References: <CAJygYd2T9JSJCDT178F8mzmuA79MsBbWCLsr8eF7Aguxk_-YWQ@mail.gmail.com> <CAJygYd1tU+Nc5+owTw0Lfuk8SWQQS2vE1mhKjoz5br4c9zVF8A@mail.gmail.com> <20151021105300.GN5319@calimero.vinschen.de> <CAJygYd3o5tjmLx8e8zCFi+T5LxzBLk02nMrcC03Fp-MbnuBsHQ@mail.gmail.com> <20151021141523.GV5319@calimero.vinschen.de> <CAJygYd1a82LVP0EuKyDtrux=6uJ=rN95yRghy3sdkKU+_9yt5Q@mail.gmail.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;	protocol="application/pgp-signature"; boundary="qMm9M+Fa2AknHoGS"
Content-Disposition: inline
In-Reply-To: <CAJygYd1a82LVP0EuKyDtrux=6uJ=rN95yRghy3sdkKU+_9yt5Q@mail.gmail.com>
User-Agent: Mutt/1.5.23 (2014-03-12)

--qMm9M+Fa2AknHoGS
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Oct 21 22:43, Yucong Sun wrote:
> On Wed, Oct 21, 2015 at 10:15 PM, Corinna Vinschen
> <corinna-cygwin@cygwin.com> wrote:
> > 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.
>=20
> Possibly, jemalloc already have support of this.  However I wasn't so
> sure that this was possible before,
>=20
> see https://github.com/jemalloc/jemalloc/blob/dev/include/jemalloc/intern=
al/mutex.h#L80

Yes, that looks good.  Please use critical sections for the time being.
We're going to drop XP support end of this year, but up to that point we
can't use SRW locks.


Thanks,
Corinna

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

--qMm9M+Fa2AknHoGS
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJWJ7HlAAoJEPU2Bp2uRE+gmeQP/jeKklWZcEcxqmkQOxyQt6cW
jkJG51qJj1RpodBexXBPRj/qIwfvOuYbpK4C490+mO4wGDaHfRtlQYNrBUWHhGzQ
Mk9Ja/GC29Xxf+TcBGfLOnKb6XaSESpMjFBB21JAHNaT++UhpjWjmknn5uCeYa75
xzkwnwpdKNiic/wBDZ5bi9MbZr0a07yL6dM/4t/yIxz9/wM1ddmx8ywFoFeRYGEw
Lry9Da0Ng8EUcIWeZEHJY4CUddRCuVT1wXXyj3uLLF/15F5K9FfuqjwDDZITgK5G
36zMNPnkqlEUh5nDkeyV3Y+JVHaqabUVFGHCLE4vGAkUeIobf8fNzvHJG56InoQa
2XHkA7va7K2p3VOY78KptKyddEhKvq/um6nvN/2kW97m8JaF9B6mGuIQmMrYirso
lBVCf1NohhqthM5yL3gK6D7cuF5apFgTjBDi7+JNR31zHUNGK/QMBMVtiSl2mj7O
kgEC1WNQFVgOLFUMMHXV310VVal4zuD4o2ta0BeJxuMg3x2iI7V3aJiTQoKdioPh
5X2by+Bw5CkurBCWVLDcpoqdkTb1wwkS0CE/US+oPmM9KVa1l8NV003nmY1LlSRa
RWIqcT2kV8+cYAb2a8PSM5bqvcyu+2Vvutz0l82tPG7EYC7fm7ZkaNfBSmygdC8Q
weCAdl2YXfVXGiY5BK7D
=YMYb
-----END PGP SIGNATURE-----

--qMm9M+Fa2AknHoGS--
