[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can we go GTK-only?

From: Eli Zaretskii
Subject: Re: Can we go GTK-only?
Date: Tue, 01 Nov 2016 18:54:35 +0200

> Date: Tue, 1 Nov 2016 12:41:12 -0400
> From: "Perry E. Metzger" <address@hidden>
> Cc: Daniel Colascione <address@hidden>, address@hidden,
>  address@hidden, address@hidden
> On Tue, 01 Nov 2016 17:11:57 +0200 Eli Zaretskii <address@hidden> wrote:
> > > Of course you can call malloc from multiple threads. Otherwise,
> > > projects like jemalloc would be pointless. You can freely
> > > allocate and deallocate from different threads on both POSIX and
> > > Windows systems, and there is no need to free an object on the
> > > thread that allocated it.  
> > 
> > IMO, this is not a safe assumption, even though in practice more and
> > more systems out there provide thread-safe native malloc.  Only C11
> > mandates that malloc/realloc/free shall be thread-safe, and we don't
> > yet require C11.
> I was under the impression the requirement that malloc be thread safe
> was before now a POSIX/pthreads thing, not a C standard thing, and
> that this had been the case for a very long time.

We don't only support POSIX platforms.  And even for POSIX platforms,
you can find on the net reports about thread-unsafe malloc up to 2013
and 2014.  That's not "very long time".

> I can look up old versions of the standard but I believe it was the
> case as long as pthreads has been around.

My concern is not with the standards, but with the actual situation
out there.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]