Using Threads

Scott Lystig Fritchie fritchie@REDACTED
Thu Jun 7 15:05:05 CEST 2001

>>>>> "sh" == Sean Hinde <Sean.Hinde@REDACTED> writes:

sh> [The +A flag] works as below for the commercial Solaris version on my
sh> machine:
sh> [...]
sh> The version I compiled from open source gives the same response as
sh> you got.

If I recall correctly, I had to do a couple of things to get threads
support with the open source release.  I don't have time to confirm
them before sending this message, but perhaps you can work it out from
here.  {shrug}

Disclaimer: this is what I recall I had to do with open source R7B-1
under Linux, FreeBSD, and Solaris.  YMMV.

After running the top-level "configure", I had to manually edit
erts/emulator/Makefile to add what configure should've added when
using the I-forget-the-configure-flag-that-should've-enabled-os-
thread-support (enable-threads?).  The configure-substituted symbols
are THR_DEFS (in CFLAGS) and THR_LIBS (in LIBS) (see
erts/emulator/  The OS-appropriate values for the THR_*
symbols can be found in erts/autoconf/configure.  

	Solaris & Linux:




You'll come to much grief and woe if you don't include -DUSE_THREADS

If you did the build stuff correctly, you'd see this at startup:

   % erl
   Erlang (BEAM) emulator version [source] [threads]
   Eshell V5.0.1.1  (abort with ^G)

Second, I recall (fuzzy memory) that the +A flag still didn't work.  I
had to set the ERL_THREAD_POOL_SIZE environment variable to get 
erlang:system_info(thread_pool_size) to spit out something non-zero.


More information about the erlang-questions mailing list