diff options
author | Rickard Green <[email protected]> | 2011-10-09 01:00:51 +0200 |
---|---|---|
committer | Rickard Green <[email protected]> | 2011-11-13 20:40:57 +0100 |
commit | 9bed74c6b44f691c7c6572ec2c9f57219d8894a6 (patch) | |
tree | 55d10811da3b4e0bb8aa22aeea50112cb846149b /erts/emulator/beam/erl_alloc.types | |
parent | bc5818cfdd56e19a16357f4443d80a56426aa134 (diff) | |
download | otp-9bed74c6b44f691c7c6572ec2c9f57219d8894a6.tar.gz otp-9bed74c6b44f691c7c6572ec2c9f57219d8894a6.tar.bz2 otp-9bed74c6b44f691c7c6572ec2c9f57219d8894a6.zip |
Implement generic lock-free queue
The implementation of an ERTS internal, generic, many to one, lock-free
queue for communication between threads. The many to one scenario is
very common in ERTS, so it can be used in a lot of places in the future.
Changing to this queue from a lock based queue, however, often requires
some redesigning. This since we have often used the lock of the queue
to protect other information too.
Diffstat (limited to 'erts/emulator/beam/erl_alloc.types')
-rw-r--r-- | erts/emulator/beam/erl_alloc.types | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_alloc.types b/erts/emulator/beam/erl_alloc.types index 79d3433fc0..4efad0197b 100644 --- a/erts/emulator/beam/erl_alloc.types +++ b/erts/emulator/beam/erl_alloc.types @@ -50,6 +50,15 @@ # command line argument to make_alloc_types. The variable X is false # after a "+disable X" statement or if it has never been mentioned. ++if smp ++disable threads_no_smp ++else ++if threads ++enable threads_no_smp ++else ++disable threads_no_smp ++endif ++endif # --- Allocator declarations ------------------------------------------------- # @@ -254,6 +263,19 @@ type ZLIB STANDARD SYSTEM zlib type CPU_GRPS_MAP LONG_LIVED SYSTEM cpu_groups_map type AUX_WORK_TMO LONG_LIVED SYSTEM aux_work_timeouts ++if threads_no_smp +# Need thread safe allocs, but std_alloc and fix_alloc are not; +# use driver_alloc which is... +type THR_Q_EL DRIVER SYSTEM thr_q_element +type THR_Q_EL_SL DRIVER SYSTEM sl_thr_q_element ++else +type THR_Q_EL STANDARD SYSTEM thr_q_element +type THR_Q_EL_SL FIXED_SIZE SYSTEM sl_thr_q_element ++endif +type THR_Q STANDARD SYSTEM thr_queue +type THR_Q_SL SHORT_LIVED SYSTEM short_lived_thr_queue +type THR_Q_LL LONG_LIVED SYSTEM long_lived_thr_queue + +if smp type ASYNC SHORT_LIVED SYSTEM async +else |