提交 2c2213b5 编写于 作者: Y youngwolf

Revise comments.

上级 d22c15e7
......@@ -5,7 +5,7 @@
#define ASCS_SERVER_PORT 9527
#define ASCS_MAX_OBJECT_NUM 102400
#define ASCS_REUSE_OBJECT //use objects pool
#define ASCS_DELAY_CLOSE 5 //define this to avoid hooks for async call (and slightly improve efficiency)
#define ASCS_DELAY_CLOSE 5 //define this to avoid hooks for async call (and slightly improve performance)
#define ASCS_MSG_BUFFER_SIZE 1024
#define ASCS_SYNC_DISPATCH
#ifdef ASCS_SYNC_DISPATCH
......
......@@ -6,7 +6,7 @@
#define ASCS_MAX_OBJECT_NUM 102400
#define ASCS_ASYNC_ACCEPT_NUM 1024 //pre-create 1024 server socket, this is very useful if creating server socket is very expensive
#define ASCS_REUSE_OBJECT //use objects pool
#define ASCS_DELAY_CLOSE 5 //define this to avoid hooks for async call (and slightly improve efficiency)
#define ASCS_DELAY_CLOSE 5 //define this to avoid hooks for async call (and slightly improve performance)
#define ASCS_MSG_BUFFER_SIZE 1024
#define ASCS_SYNC_DISPATCH
#ifdef ASCS_SYNC_DISPATCH
......
......@@ -4,12 +4,12 @@
//configuration
#define ASCS_SERVER_PORT 9527
//#define ASCS_REUSE_OBJECT //use objects pool
#define ASCS_DELAY_CLOSE 5 //define this to avoid hooks for async call (and slightly improve efficiency)
#define ASCS_DELAY_CLOSE 5 //define this to avoid hooks for async call (and slightly improve performance)
//#define ASCS_CLEAR_OBJECT_INTERVAL 1
#define ASCS_SYNC_DISPATCH
#define ASCS_DISPATCH_BATCH_MSG
//#define ASCS_WANT_MSG_SEND_NOTIFY
//#define ASCS_FULL_STATISTIC //full statistic will slightly impact efficiency
//#define ASCS_FULL_STATISTIC //full statistic will slightly impact performance
#define ASCS_AVOID_AUTO_STOP_SERVICE
//#define ASCS_DECREASE_THREAD_AT_RUNTIME
//#define ASCS_MAX_SEND_BUF 65536
......
......@@ -7,7 +7,7 @@
//#define ASCS_FREE_OBJECT_INTERVAL 60 //it's useless if ASCS_REUSE_OBJECT macro been defined
//#define ASCS_SYNC_DISPATCH //do not open this feature, see below for more details
#define ASCS_DISPATCH_BATCH_MSG
//#define ASCS_FULL_STATISTIC //full statistic will slightly impact efficiency
//#define ASCS_FULL_STATISTIC //full statistic will slightly impact performance
#define ASCS_USE_STEADY_TIMER
#define ASCS_ALIGNED_TIMER
#define ASCS_AVOID_AUTO_STOP_SERVICE
......
......@@ -3,7 +3,7 @@
//configuration
#define ASCS_SERVER_PORT 5050
#define ASCS_DELAY_CLOSE 5 //define this to avoid hooks for async call (and slightly improve efficiency)
#define ASCS_DELAY_CLOSE 5 //define this to avoid hooks for async call (and slightly improve performance)
#define ASCS_PASSIVE_RECV
#ifndef ASCS_DECREASE_THREAD_AT_RUNTIME
#define ASCS_AVOID_AUTO_STOP_SERVICE
......
......@@ -4,7 +4,7 @@
//configuration
#define ASCS_SERVER_PORT 9527
#define ASCS_REUSE_OBJECT //use objects pool
#define ASCS_DELAY_CLOSE 5 //define this to avoid hooks for async call (and slightly improve efficiency)
#define ASCS_DELAY_CLOSE 5 //define this to avoid hooks for async call (and slightly improve performance)
#define ASCS_SYNC_DISPATCH
//#define ASCS_WANT_MSG_SEND_NOTIFY
#define ASCS_MSG_BUFFER_SIZE 65536
......
......@@ -4,7 +4,7 @@
//configuration
#define ASCS_SERVER_PORT 9527
#define ASCS_REUSE_OBJECT //use objects pool
#define ASCS_DELAY_CLOSE 5 //define this to avoid hooks for async call (and slightly improve efficiency)
#define ASCS_DELAY_CLOSE 5 //define this to avoid hooks for async call (and slightly improve performance)
#define ASCS_SYNC_DISPATCH
#define ASCS_MSG_BUFFER_SIZE 65536
#define ASCS_DEFAULT_UNPACKER stream_unpacker //non-protocol
......
......@@ -445,7 +445,7 @@ struct statistic
uint_fast64_t recv_byte_sum; //msgs (in bytes) returned by i_unpacker::parse_msg
stat_duration dispatch_delay_sum; //from parse_msg(exclude msg unpacking) to on_msg_handle
stat_duration recv_idle_sum; //during this duration, socket suspended msg reception (receiving buffer overflow)
stat_duration handle_time_sum; //on_msg_handle (and on_msg) consumed time, this indicate the efficiency of msg handling
stat_duration handle_time_sum; //on_msg_handle (and on_msg) consumed time, this indicate the performance of msg handling
stat_duration unpack_time_sum; //udp::socket_base will not gather this item
time_t establish_time; //time of link establishment
......
......@@ -63,7 +63,7 @@
* Drop macro ASCS_USE_CONCURRENT_QUEUE, rename macro ASCS_USE_CONCURRE to ASCS_HAS_CONCURRENT_QUEUE.
* In contrast to non_lock_queue, split message_queue into lock_queue and lock_free_queue.
* Move container related classes and functions from base.h to container.h.
* Improve efficiency in scenarios of low throughput like pingpong test.
* Improve performance in scenarios of low throughput like pingpong test.
* Move class statistic and obj_with_begin_time out of ascs::socket to reduce template tiers.
*
* 2016.11.1 version 1.1.2
......@@ -398,7 +398,7 @@
*
* HIGHLIGHT:
* Fully support sync message sending and receiving (even be able to mix with async message sending and receiving without any limitations), but please note
* that this feature will slightly impact efficiency even if you always use async message sending and receiving, so only open this feature when really needed.
* that this feature will slightly impact performance even if you always use async message sending and receiving, so only open this feature when really needed.
*
* FIX:
* Fix race condition when aligning timers, see macro ASCS_ALIGNED_TIMER for more details.
......@@ -960,7 +960,7 @@ static_assert(ASCS_MAX_RECV_BUF > 0, "recv buffer capacity must be bigger than z
//you must define this macro as a value, not just define it, the value means the duration, unit is second.
//a value equal to zero will cause ascs to use a mechanism to guarantee 100% safety when reusing or freeing this socket,
//ascs will hook all async calls to avoid this socket to be reused or freed before all async calls finish
//or been interrupted (of course, this mechanism will slightly impact efficiency).
//or been interrupted (of course, this mechanism will slightly impact performance).
#ifndef ASCS_DELAY_CLOSE
#define ASCS_DELAY_CLOSE 0 //seconds, guarantee 100% safety when reusing or freeing socket objects
#endif
......@@ -1216,7 +1216,7 @@ static_assert(ASCS_MSG_HANDLING_INTERVAL >= 0, "the interval of msg handling mus
// sync_safe_send_native_msg
// sync_recv_msg
//please note that:
// this feature will slightly impact efficiency even if you always use async message sending and receiving, so only open this feature when really needed.
// this feature will slightly impact performance even if you always use async message sending and receiving, so only open this feature when really needed.
// we must avoid to do sync message sending and receiving in service threads.
// if prior sync_recv_msg() not returned, the second sync_recv_msg() will return false immediately.
// with macro ASCS_PASSIVE_RECV, in sync_recv_msg(), recv_msg() will be automatically called, but the first one (right after the connection been established)
......@@ -1230,7 +1230,7 @@ static_assert(ASCS_MSG_HANDLING_INTERVAL >= 0, "the interval of msg handling mus
//#define ASCS_SYNC_DISPATCH
//with this macro, virtual bool on_msg(std::list<OutMsgType>& msg_can) will be provided, you can rewrite it and handle all or a part of the
// messages like virtual function on_msg_handle (with macro ASCS_DISPATCH_BATCH_MSG), if your logic is simple enough (like echo or pingpong test),
// this feature is recommended because it can slightly improve efficiency.
// this feature is recommended because it can slightly improve performance.
//now we have three ways to handle messages (sync_recv_msg, on_msg and on_msg_handle), the invocation order is the same as listed, if messages been successfully
// dispatched to sync_recv_msg, then the second two will not be called, otherwise messages will be dispatched to on_msg, if on_msg only handled a part of (include
// zero) the messages, then on_msg_handle will continue to dispatch the rest of them asynchronously, this will disorder messages because on_msg_handle and the next
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册