libzmq  master
ZeroMQ C++ Core Engine (LIBZMQ)
config.hpp
Go to the documentation of this file.
1 /*
2  Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file
3 
4  This file is part of libzmq, the ZeroMQ core engine in C++.
5 
6  libzmq is free software; you can redistribute it and/or modify it under
7  the terms of the GNU Lesser General Public License (LGPL) as published
8  by the Free Software Foundation; either version 3 of the License, or
9  (at your option) any later version.
10 
11  As a special exception, the Contributors give you permission to link
12  this library with independent modules to produce an executable,
13  regardless of the license terms of these independent modules, and to
14  copy and distribute the resulting executable under terms of your choice,
15  provided that you also meet, for each linked independent module, the
16  terms and conditions of the license of that module. An independent
17  module is a module which is not derived from or based on this library.
18  If you modify this library, you must extend this exception to your
19  version of the library.
20 
21  libzmq is distributed in the hope that it will be useful, but WITHOUT
22  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
23  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
24  License for more details.
25 
26  You should have received a copy of the GNU Lesser General Public License
27  along with this program. If not, see <http://www.gnu.org/licenses/>.
28 */
29 
30 #ifndef __ZMQ_CONFIG_HPP_INCLUDED__
31 #define __ZMQ_CONFIG_HPP_INCLUDED__
32 
33 namespace zmq
34 {
35 
36  // Compile-time settings.
37 
38  enum
39  {
40  // Number of new messages in message pipe needed to trigger new memory
41  // allocation. Setting this parameter to 256 decreases the impact of
42  // memory allocation by approximately 99.6%
44 
45  // Commands in pipe per allocation event.
47 
48  // Determines how often does socket poll for new commands when it
49  // still has unprocessed messages to handle. Thus, if it is set to 100,
50  // socket will process 100 inbound messages before doing the poll.
51  // If there are no unprocessed messages available, poll is done
52  // immediately. Decreasing the value trades overall latency for more
53  // real-time behaviour (less latency peaks).
55 
56  // Maximal batching size for engines with receiving functionality.
57  // So, if there are 10 messages that fit into the batch size, all of
58  // them may be read by a single 'recv' system call, thus avoiding
59  // unnecessary network stack traversals.
60  in_batch_size = 8192,
61 
62  // Maximal batching size for engines with sending functionality.
63  // So, if there are 10 messages that fit into the batch size, all of
64  // them may be written by a single 'send' system call, thus avoiding
65  // unnecessary network stack traversals.
67 
68  // Maximal delta between high and low watermark.
69  max_wm_delta = 1024,
70 
71  // Maximum number of events the I/O thread can process in one go.
73 
74  // Maximal delay to process command in API thread (in CPU ticks).
75  // 3,000,000 ticks equals to 1 - 2 milliseconds on current CPUs.
76  // Note that delay is only applied when there is continuous stream of
77  // messages to process. If not so, commands are processed immediately.
78  max_command_delay = 3000000,
79 
80  // Low-precision clock precision in CPU ticks. 1ms. Value of 1000000
81  // should be OK for CPU frequencies above 1GHz. If should work
82  // reasonably well for CPU frequencies above 500MHz. For lower CPU
83  // frequencies you may consider lowering this value to get best
84  // possible latencies.
85  clock_precision = 1000000,
86 
87  // On some OSes the signaler has to be emulated using a TCP
88  // connection. In such cases following port is used.
89  // If 0, it lets the OS choose a free port without requiring use of a
90  // global mutex. The original implementation of a Windows signaler
91  // socket used port 5905 instead of letting the OS choose a free port.
92  // https://github.com/zeromq/libzmq/issues/1542
94  };
95 
96 }
97 
98 #endif
Definition: address.hpp:35