unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Fabrice Popineau <fabrice.popineau@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: Emacs-26 threads problem [win64]
Date: Wed, 11 Oct 2017 13:02:23 +0300	[thread overview]
Message-ID: <8360bmovdc.fsf@gnu.org> (raw)
In-Reply-To: <CAFgFV9M=DQiQEphKnPp7eFkgzy1U0iUZ+hfDngeow6xFzU4+9A@mail.gmail.com> (message from Fabrice Popineau on Tue, 10 Oct 2017 22:14:58 +0200)

> From: Fabrice Popineau <fabrice.popineau@gmail.com>
> Date: Tue, 10 Oct 2017 22:14:58 +0200
> Cc: Emacs developers <emacs-devel@gnu.org>
> 
>  > (while (> (length (all-threads)) 1)
>  > (sleep-for 0.1))
>  >
>  > This makes all the 28 tests pass.
> 
>  And the address of stack_pos doesn't grow anymore?
> 
> Yes, it still does. Apparently not out of bounds, because I have run the tests several times. 

Can you show the values?  What I see here is that it goes up one or 2
notches up to test #6, and then goes back and never grows in the rest
of the tests.

>  > A bit scary though.
> 
>  Why scary?
> 
> I don't like to be at the whim of such a waiting loop before being able to run another thread.

Since each thread uses up some stack space, why is it surprising that
given enough threads running, we get a C stack overflow?

Perhaps it's time to discuss whether we should place some restrictions
on the thread stack space.  Right now, we leave the stack size of the
thread to the system defaults, which in the Windows case means 8MB,
the size specified for the main program in the executable's header.
AFAIK, on Unix the default is 2MB, but can be changed via RLIMIT_STACK
setting.  Maybe these 2 values are too much, but OTOH these threads
need to be able to run the same Lisp programs as the main thread, so
it's unclear whether we can safely decrease the stack size.



  reply	other threads:[~2017-10-11 10:02 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-09 19:48 Emacs-26 threads problem [win64] Fabrice Popineau
2017-10-10  6:25 ` Eli Zaretskii
2017-10-10 16:13   ` Fabrice Popineau
2017-10-10 16:30     ` Eli Zaretskii
2017-10-10 16:48       ` Eli Zaretskii
2017-10-10 18:57         ` Fabrice Popineau
2017-10-10 19:39           ` Eli Zaretskii
2017-10-10 19:58             ` Fabrice Popineau
2017-10-10 20:09               ` Eli Zaretskii
2017-10-10 20:14                 ` Fabrice Popineau
2017-10-11 10:02                   ` Eli Zaretskii [this message]
2017-10-13 18:52                   ` Eli Zaretskii
2017-10-13 22:00                     ` Richard Copley
2017-10-14  6:39                       ` Eli Zaretskii
2017-10-13 22:28                     ` Paul Eggert
2017-10-14  6:47                       ` Eli Zaretskii
2017-10-14  8:05                         ` Paul Eggert
2017-10-14  8:25                           ` Eli Zaretskii
2017-10-14  9:28                             ` Paul Eggert
2017-10-14  9:30                               ` Andreas Schwab
2017-10-14 10:33                                 ` Eli Zaretskii
2017-10-14 11:31                                   ` Andreas Schwab
2017-10-14 12:18                                     ` Eli Zaretskii
2017-10-14 12:39                                       ` Andreas Schwab
2017-10-14 14:00                                         ` Eli Zaretskii
2017-10-14 22:51                                           ` Paul Eggert
2017-10-15 15:14                                             ` Eli Zaretskii
2017-10-15 15:39                                               ` Andreas Schwab
2017-10-15 16:30                                                 ` Eli Zaretskii
2017-10-15 16:41                                                   ` Stefan Monnier
2017-10-15 17:19                                                     ` Eli Zaretskii
2017-10-15 16:47                                                   ` Andreas Schwab
2017-10-14  9:26                           ` Andreas Schwab
2017-10-14  9:31                             ` Paul Eggert
2017-10-14 19:06                           ` Fabrice Popineau
2017-10-10 18:55       ` Fabrice Popineau

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8360bmovdc.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=fabrice.popineau@gmail.com \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).