Commit 8cddd348 authored by Howard Chu's avatar Howard Chu
Browse files

Add support for multiple listener threads. Lightly tested on Linux,

Winsock needs a couple more tweaks
parent a8ffb633
......@@ -194,6 +194,7 @@ enum {
CFG_SYNTAX,
CFG_ACL_ADD,
CFG_SYNC_SUBENTRY,
CFG_LTHREADS,
CFG_LAST
};
......@@ -415,6 +416,14 @@ static ConfigTable config_back_cf_table[] = {
&config_generic, "( OLcfgDbAt:0.5 NAME 'olcLimits' "
"EQUALITY caseIgnoreMatch "
"SYNTAX OMsDirectoryString X-ORDERED 'VALUES' )", NULL, NULL },
{ "listener-threads", "count", 2, 0, 0,
#ifdef NO_THREADS
ARG_IGNORED, NULL,
#else
ARG_UINT|ARG_MAGIC|CFG_LTHREADS, &config_generic,
#endif
"( OLcfgGlAt:93 NAME 'olcListenerThreads' "
"SYNTAX OMsInteger SINGLE-VALUE )", NULL, NULL },
{ "localSSF", "ssf", 2, 2, 0, ARG_INT,
&local_ssf, "( OLcfgGlAt:26 NAME 'olcLocalSSF' "
"SYNTAX OMsInteger SINGLE-VALUE )", NULL, NULL },
......@@ -920,6 +929,9 @@ config_generic(ConfigArgs *c) {
case CFG_TTHREADS:
c->value_int = slap_tool_thread_max;
break;
case CFG_LTHREADS:
c->value_uint = slapd_daemon_threads;
break;
case CFG_SALT:
if ( passwd_salt )
c->value_string = ch_strdup( passwd_salt );
......@@ -1262,6 +1274,7 @@ config_generic(ConfigArgs *c) {
case CFG_CONCUR:
case CFG_THREADS:
case CFG_TTHREADS:
case CFG_LTHREADS:
case CFG_RO:
case CFG_AZPOLICY:
case CFG_DEPTH:
......@@ -1613,6 +1626,19 @@ config_generic(ConfigArgs *c) {
slap_tool_thread_max = c->value_int; /* save for reference */
break;
case CFG_LTHREADS:
{ int mask = 0;
/* use a power of two */
while (c->value_uint > 1) {
c->value_uint >>= 1;
mask <<= 1;
mask |= 1;
}
slapd_daemon_mask = mask;
slapd_daemon_threads = mask+1;
}
break;
case CFG_SALT:
if ( passwd_salt ) ch_free( passwd_salt );
passwd_salt = c->value_string;
......
This diff is collapsed.
......@@ -843,8 +843,6 @@ LDAP_SLAPD_F (int) slapd_daemon(void);
LDAP_SLAPD_F (Listener **) slapd_get_listeners LDAP_P((void));
LDAP_SLAPD_F (void) slapd_remove LDAP_P((ber_socket_t s, Sockbuf *sb,
int wasactive, int wake, int locked ));
LDAP_SLAPD_F (void) slapd_sd_lock LDAP_P((void));
LDAP_SLAPD_F (void) slapd_sd_unlock LDAP_P((void));
LDAP_SLAPD_F (RETSIGTYPE) slap_sig_shutdown LDAP_P((int sig));
LDAP_SLAPD_F (RETSIGTYPE) slap_sig_wake LDAP_P((int sig));
......@@ -863,6 +861,8 @@ LDAP_SLAPD_V (int) slapd_register_slp;
LDAP_SLAPD_V (const char *) slapd_slp_attrs;
LDAP_SLAPD_V (slap_ssf_t) local_ssf;
LDAP_SLAPD_V (struct runqueue_s) slapd_rq;
LDAP_SLAPD_V (int) slapd_daemon_threads;
LDAP_SLAPD_V (int) slapd_daemon_mask;
#ifdef LDAP_TCP_BUFFER
LDAP_SLAPD_V (int) slapd_tcp_rmem;
LDAP_SLAPD_V (int) slapd_tcp_wmem;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment