From 6487aac5977cf470bc6a2cd0964da2850ee38717 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Thu, 30 Oct 2014 23:57:01 +0100 Subject: Introduce a new time API The old time API is based on erlang:now/0. The major issue with erlang:now/0 is that it was intended to be used for so many unrelated things. This tied these unrelated operations together and unnecessarily caused performance, scalability as well as accuracy, and precision issues for operations that do not need to have such issues. The new API spreads different functionality over multiple functions in order to improve on this. The new API consists of a number of new BIFs: - erlang:convert_time_unit/3 - erlang:monotonic_time/0 - erlang:monotonic_time/1 - erlang:system_time/0 - erlang:system_time/1 - erlang:time_offset/0 - erlang:time_offset/1 - erlang:timestamp/0 - erlang:unique_integer/0 - erlang:unique_integer/1 - os:system_time/0 - os:system_time/1 and a number of extensions of existing BIFs: - erlang:monitor(time_offset, clock_service) - erlang:system_flag(time_offset, finalize) - erlang:system_info(os_monotonic_time_source) - erlang:system_info(time_offset) - erlang:system_info(time_warp_mode) - erlang:system_info(time_correction) - erlang:system_info(start_time) See the "Time and Time Correction in Erlang" chapter of the ERTS User's Guide for more information. --- system/doc/efficiency_guide/advanced.xml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'system') diff --git a/system/doc/efficiency_guide/advanced.xml b/system/doc/efficiency_guide/advanced.xml index 51f1b2612c..ed7a6670ed 100644 --- a/system/doc/efficiency_guide/advanced.xml +++ b/system/doc/efficiency_guide/advanced.xml @@ -199,6 +199,31 @@ On 64-bit architectures: 4 words for a reference from the current local node, an available, and operating system specific settings and limits. Number of arguments to a function or fun 255 + Unique References on a Runtime System Instance + Each scheduler thread has its own set of references, and all + other threads have a shared set of references. Each set of references + consist of 2⁶⁴ - 1 unique references. That is the total + amount of unique references that can be produced on a runtime + system instance is (NoSchedulers + 1) * (2⁶⁴ - 1). If a + scheduler thread create a new reference each nano second, + references will at earliest be reused after more than 584 years. + That is, for the foreseeable future they are unique enough. + Unique Integers on a Runtime System Instance + There are two types of unique integers both created using the + erlang:unique_integer() + BIF. Unique integers created: + + with the monotonic modifier + consist of a set of 2⁶⁴ - 1 unique integers. + without the monotonic modifier + consist of a set of 2⁶⁴ - 1 unique integers per scheduler + thread and a set of 2⁶⁴ - 1 unique integers shared by + other threads. That is the total amount of unique integers without + the monotonic modifier is (NoSchedulers + 1) * (2⁶⁴ - 1) + + If a unique integer is created each nano second, unique integers + will at earliest be reused after more than 584 years. That is, for + the foreseeable future they are unique enough. -- cgit v1.2.3