[Top][All Lists]

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

Re: Can we go GTK-only?

From: Perry E. Metzger
Subject: Re: Can we go GTK-only?
Date: Tue, 1 Nov 2016 13:22:02 -0400

On Tue, 01 Nov 2016 18:54:35 +0200 Eli Zaretskii <address@hidden> wrote:
> > 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.

It is also the case on Windows and on all non-POSIX platforms I'm
aware of that are of significance. That said, I don't believe that
Emacs supports much other than POSIX and Windows, so we could easily
check the others.

> 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".

Are you sure this wasn't just a report from some people who linked
with the wrong library?

The standard has required that malloc be thread safe as long as
pthreads has been around IIRC. I'm unaware of any such reports of
lack of support, but if they exist, it would indicate a desperately
broken platform that couldn't run any thread safe code to speak of.
One of the first things one needs to do in order to support pthreads
is to produce a libc that knows about pthread safety. If you don't
have that, you can port essentially 0 thread safe programs and users
can write essentially nothing. malloc is a very basic call.

I could be wrong here, of course, but I'd need to see much more
concrete evidence of it.

> > 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.

The actual implementations *have* to handle thread safety of the basic
library calls or basically no software will run. malloc is such a
basic call that if you didn't handle it correctly you couldn't expect
pthreads to be of any use on your platform.

Perry E. Metzger                address@hidden

reply via email to

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