Commit 425c664a authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

This is slightly experimental:

Reduce SHM mutex contention further, by only holding lock over
reservation of space, and do the copying from workthread buffer
to shm buffer efter we let go of the mutex.


git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@2590 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 483b4771
......@@ -185,13 +185,13 @@ WSL_Flush(struct worker *w, int overflow)
if (loghead->ptr + l + 1 >= loghead->size)
vsl_wrap();
p = logstart + loghead->ptr;
memcpy(p + 1, w->wlb + 1, l - 1);
p[l] = SLT_ENDMARKER;
loghead->ptr += l;
assert(loghead->ptr < loghead->size);
UNLOCKSHM(&vsl_mtx);
memcpy(p + 1, w->wlb + 1, l - 1);
/* XXX: memory barrier here */
p[0] = w->wlb[0];
UNLOCKSHM(&vsl_mtx);
w->wlp = w->wlb;
w->wlr = 0;
}
......
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