[erlang-questions] erl using 99% CPU while idle
Wed Mar 28 10:01:47 CEST 2012
> On Tue, Mar 27, 2012 at 9:37 AM, Frank Hunleth
> <fhunleth@REDACTED> wrote:
>> I was wondering if anyone had seen erl, specifically the
>> erts-5.9/bin/beam process, run at 99% CPU while at the shell prompt.
> Finally found the issue! This was caused by passing the
> "--disable-threads" option to ./configure when compiling erlang.
> Removing the option (the default is --enable-threads) and recompiling
> fixes the problem.
The following fix for this has successfully passed one daily build, and
will probably appear as it is in R15B01. As you noted, this bug does not
appear unless you disable thread support. This bug was first introduced
diff --git a/erts/emulator/sys/common/erl_poll.c
index 3817b1e..2685805 100644
@@ -2143,7 +2143,7 @@ ERTS_POLL_EXPORT(erts_poll_wait)(ErtsPollSet ps,
ERTS_POLL_EXPORT(erts_poll_interrupt)(ErtsPollSet ps, int set)
+#if defined(USE_THREADS) || ERTS_POLL_ASYNC_INTERRUPT_SUPPORT
> One last question: Besides fixing the above issue, I'm a little
> confused on what --enable-threads does for me.
This only enable thread support for the runtime system (builds runtime
system with -D_REENTRANT etc).
> I see "[async-threads:
> 0]", so does that mean that even though they're enabled, they won't be
> used by default?
No they will not be enabled by default. You enable them by passing
+A<NoAsyncThreads> as a command line argument to erl.
> erlang-questions mailing list
Rickard Green, Erlang/OTP, Ericsson AB.
More information about the erlang-questions