From: Eli Zaretskii <eliz@gnu.org>
To: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Cc: perry@piermont.com, dancol@dancol.org, raeburn@raeburn.org,
monnier@iro.umontreal.ca, emacs-devel@gnu.org
Subject: Re: Can we go GTK-only?
Date: Wed, 02 Nov 2016 17:46:26 +0200 [thread overview]
Message-ID: <83mvhhnaul.fsf@gnu.org> (raw)
In-Reply-To: <wlpomecw72.wl%mituharu@math.s.chiba-u.ac.jp> (message from YAMAMOTO Mitsuharu on Wed, 02 Nov 2016 14:00:49 +0900)
> Date: Wed, 02 Nov 2016 14:00:49 +0900
> From: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
> Cc: Daniel Colascione <dancol@dancol.org>,
> raeburn@raeburn.org,
> emacs-devel@gnu.org,
> monnier@iro.umontreal.ca,
> perry@piermont.com
>
> > The only platform I know about that starts non-main threads which
> > run Emacs application code is MS-Windows, and there we don't
> > allocate anything off the heap, at least not off the same heap that
> > is used by the main (Lisp) thread.
>
> The font backend driver macfont.m imported from the Mac port does
> deallocation off the main thread for some data that were allocated in
> the main thread.
>
> 1489 dispatch_group_async (group, queue, ^{
> 1490 int nkeys;
> 1491 uintptr_t key;
> 1492 nkeys = nkeys_or_perm;
> 1493 for (key = row * (256 / NGLYPHS_IN_VALUE); ; key++)
> 1494 if (CFDictionaryContainsKey (dictionary,
> 1495 (const void *) key))
> 1496 {
> 1497 CFDictionaryRemoveValue (dictionary,
> 1498 (const void *) key);
> 1499 if (--nkeys == 0)
> 1500 break;
> 1501 }
> 1502 });
>
> I can disable this for NS if it does not fit with the current policy
> of GNU Emacs mainline source code.
I know next to nothing about NS. These are system APIs, right? If
so, calling them could be okay, and I defer to NS and OS X people here
to make that call.
One things bothers me, though: can't this arrangement, where data is
allocated in one thread and deallocated in another, cause races? Or
do these threads have means to synchronize between them?
> (You can find more use cases of threads via libdispatch in the Mac
> port. Even basic drawings are done off the main thread.)
That's okay, the non-main threads in the MS-Windows build also do some
non-trivial stuff. As long as there's no QUIT, directly or
indirectly, in those other threads, and no calls that can cons Lisp
objects or cause GC etc., threads are safe.
> Of course, external libraries would do memory allocation/deallocation
> across the threads behind the scenes.
Sure, that's not what bothers me.
Thanks.
next prev parent reply other threads:[~2016-11-02 15:46 UTC|newest]
Thread overview: 85+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-27 19:54 Can we go GTK-only? Daniel Colascione
2016-10-27 20:05 ` Frank Haun
2016-10-27 20:45 ` Daniel Colascione
2016-10-27 21:08 ` Frank Haun
2016-10-27 20:32 ` Paul Eggert
2016-10-27 23:15 ` Perry E. Metzger
2016-10-28 7:13 ` Eli Zaretskii
2016-10-28 2:35 ` Richard Stallman
2016-10-28 6:22 ` Eli Zaretskii
2016-10-28 7:27 ` Ulrich Mueller
2016-10-28 8:15 ` Eli Zaretskii
2016-10-28 10:48 ` Frank Haun
2016-10-28 12:26 ` Eli Zaretskii
2016-10-28 13:35 ` Stefan Monnier
2016-10-30 14:43 ` Ken Raeburn
2016-10-30 21:42 ` Stefan Monnier
2016-10-30 22:49 ` Daniel Colascione
2016-10-30 23:57 ` Stefan Monnier
2016-10-31 3:37 ` Eli Zaretskii
2016-10-31 15:57 ` Eli Zaretskii
2016-10-31 0:00 ` YAMAMOTO Mitsuharu
2016-10-31 8:24 ` Ken Raeburn
2016-10-31 16:34 ` Perry E. Metzger
2016-11-01 8:22 ` YAMAMOTO Mitsuharu
2016-10-31 3:33 ` Eli Zaretskii
2016-10-31 15:57 ` Perry E. Metzger
2016-10-31 15:56 ` Eli Zaretskii
2016-10-31 15:59 ` Daniel Colascione
2016-10-31 16:47 ` Eli Zaretskii
2016-10-31 17:54 ` Perry E. Metzger
2016-10-31 20:50 ` Eli Zaretskii
2016-10-31 15:52 ` Eli Zaretskii
2016-10-31 15:54 ` Eli Zaretskii
2016-10-31 18:22 ` Ken Raeburn
2016-10-31 20:53 ` Eli Zaretskii
2016-10-31 21:04 ` Daniel Colascione
2016-11-01 15:11 ` Eli Zaretskii
2016-11-01 16:28 ` Paul Eggert
2016-11-01 16:49 ` Eli Zaretskii
2016-11-01 16:54 ` Daniel Colascione
2016-11-01 17:08 ` Eli Zaretskii
2016-11-01 17:16 ` Daniel Colascione
2016-11-01 19:15 ` Perry E. Metzger
2016-11-01 19:28 ` Lars Ingebrigtsen
2016-11-01 19:31 ` Eli Zaretskii
2016-11-01 16:55 ` Paul Eggert
2016-11-01 17:15 ` Perry E. Metzger
2016-11-01 16:41 ` Perry E. Metzger
2016-11-01 16:54 ` Eli Zaretskii
2016-11-01 17:22 ` Perry E. Metzger
2016-11-01 17:46 ` Eli Zaretskii
2016-11-01 17:56 ` Perry E. Metzger
2016-11-01 19:35 ` Perry E. Metzger
2016-11-01 16:45 ` Daniel Colascione
2016-11-01 17:01 ` Eli Zaretskii
2016-11-01 17:06 ` Daniel Colascione
2016-11-01 17:15 ` Eli Zaretskii
2016-11-01 17:18 ` Daniel Colascione
2016-11-01 17:44 ` Eli Zaretskii
2016-11-01 17:45 ` Daniel Colascione
2016-11-01 19:14 ` Stefan Monnier
2016-11-01 19:22 ` Eli Zaretskii
2016-11-01 19:42 ` Perry E. Metzger
2016-11-01 19:20 ` Perry E. Metzger
2016-11-01 20:05 ` Eli Zaretskii
2016-11-01 20:17 ` Daniel Colascione
2016-11-01 20:42 ` Eli Zaretskii
2016-11-02 2:26 ` Perry E. Metzger
2016-11-02 15:49 ` Eli Zaretskii
2016-11-02 15:55 ` Daniel Colascione
2016-11-02 5:00 ` YAMAMOTO Mitsuharu
2016-11-02 15:46 ` Eli Zaretskii [this message]
2016-11-03 3:43 ` YAMAMOTO Mitsuharu
2016-11-03 17:40 ` Eli Zaretskii
2016-11-02 0:27 ` Stefan Monnier
2016-11-02 15:53 ` Eli Zaretskii
2016-11-02 16:04 ` Stefan Monnier
2016-11-02 19:25 ` Nikolaus Rath
2016-11-02 20:33 ` Paul Eggert
2016-11-03 1:25 ` Richard Stallman
2016-11-02 19:25 ` Nikolaus Rath
2016-11-02 20:13 ` Eli Zaretskii
2016-11-03 3:29 ` Perry E. Metzger
2016-11-03 18:07 ` John Wiegley
2016-11-03 22:07 ` John Wiegley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83mvhhnaul.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=dancol@dancol.org \
--cc=emacs-devel@gnu.org \
--cc=mituharu@math.s.chiba-u.ac.jp \
--cc=monnier@iro.umontreal.ca \
--cc=perry@piermont.com \
--cc=raeburn@raeburn.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.