Ignore:
Timestamp:
2009-05-11 09:57:00 (5 years ago)
Author:
Poul-Henning Kamp <phk@…>
Branches:
master, 3.0, 4.0, experimental-ims
Children:
5c0fe1
Parents:
ecca15
git-author:
Poul-Henning Kamp <phk@…> (2009-05-11 09:57:00)
git-committer:
Poul-Henning Kamp <phk@…> (2009-05-11 09:57:00)
Message:

Fix an inconsequential oversight in session management, and prevent it from
happening again:

We optimize session allocation, SES_New(), to minimize the amount
of locking the VCA_thread participates in with flip-flop lists of
free sessions: Allocate from one list, free to the other, flip lists
only when necessary.

This scheme only works if nobody but VCA_thread calls SES_New().

Background worker threads need dummy sessions and thus called into
SES_New() as well.

These calls all happen during startup, so they do in fact not mess
up the locking, but made mockery of a number of very stern comments.

Add SES_Alloc() for such "other uses" and enforce VCA_thread monopoly
with an assert.

git-svn-id:  http://www.varnish-cache.org/svn/trunk/varnish-cache@4069 d4fa192b-c00b-0410-8231-f00ffab90ce4

File:
1 edited

Legend:

Unmodified
Added
Removed
  • bin/varnishd/cache_ws.c

    r1cc48fa r32038a  
    8383} 
    8484 
     85/* 
     86 * Reset a WS to start or a given pointer, likely from WS_Snapshot 
     87 */ 
     88 
    8589void 
    8690WS_Reset(struct ws *ws, char *p) 
Note: See TracChangeset for help on using the changeset viewer.