return (o);
}
+static void
+hsh_rush(struct object *o)
+{
+ unsigned u;
+ struct sess *sp;
+
+ for (u = 0; u < params->rush_exponent; u++) {
+ sp = VTAILQ_FIRST(&o->waitinglist);
+ if (sp == NULL)
+ return;
+ VTAILQ_REMOVE(&o->waitinglist, sp, list);
+ VSL(SLT_Debug, sp->id, "of waiting list");
+ WRK_QueueSession(sp);
+ }
+}
+
void
HSH_Unbusy(struct object *o)
{
struct objhead *oh;
- struct sess *sp;
CHECK_OBJ_NOTNULL(o, OBJECT_MAGIC);
assert(o->busy);
LOCK(&oh->mtx);
}
o->busy = 0;
+ hsh_rush(o);
if (oh != NULL)
UNLOCK(&oh->mtx);
- while (1) {
- sp = VTAILQ_FIRST(&o->waitinglist);
- if (sp == NULL)
- break;
- VTAILQ_REMOVE(&o->waitinglist, sp, list);
- WRK_QueueSession(sp);
- }
}
void
}
assert(o->refcnt > 0);
r = --o->refcnt;
+ hsh_rush(o);
if (oh != NULL) {
if (!r)
VTAILQ_REMOVE(&oh->objects, o, list);
/*--------------------------------------------------------------------*/
+static void
+tweak_rush_exponent(struct cli *cli, struct parspec *par, const char *arg)
+{
+
+ (void)par;
+ tweak_generic_uint(cli, &master.rush_exponent, arg,
+ 2, UINT_MAX);
+}
+
+/*--------------------------------------------------------------------*/
+
static void
tweak_http_workspace(struct cli *cli, struct parspec *par, const char *arg)
{
"thread_pool_max parameter.",
EXPERIMENTAL,
"100", "%" },
+ { "rush_exponent", tweak_rush_exponent,
+ "How many parked request we start for each completed "
+ "request on the object.\n"
+ "NB: Even with the implict delay of delivery, "
+ "this parameter controls an exponential increase in "
+ "number of worker threads. ",
+ EXPERIMENTAL,
+ "3", "requests per request" },
{ "http_workspace", tweak_http_workspace,
"Bytes of HTTP protocol workspace allocated. "
"This space must be big enough for the entire HTTP protocol "