Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:71771 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 31217 invoked from network); 30 Jan 2014 04:50:47 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Jan 2014 04:50:47 -0000 Authentication-Results: pb1.pair.com smtp.mail=bof@bof.de; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=bof@bof.de; sender-id=pass Received-SPF: pass (pb1.pair.com: domain bof.de designates 80.242.145.70 as permitted sender) X-PHP-List-Original-Sender: bof@bof.de X-Host-Fingerprint: 80.242.145.70 mars.intermailgate.com Received: from [80.242.145.70] ([80.242.145.70:39910] helo=mars.intermailgate.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B6/3D-52228-52AD9E25 for ; Wed, 29 Jan 2014 23:50:46 -0500 Received: (qmail 11950 invoked by uid 1009); 30 Jan 2014 05:50:41 +0100 Received: from 209.85.216.42 by mars (envelope-from , uid 89) with qmail-scanner-1.25-st-qms (clamdscan: 0.96.2/18413. spamassassin: 3.3.1. perlscan: 1.25-st-qms. Clear:RC:1(209.85.216.42):. Processed in 0.06944 secs); 30 Jan 2014 04:50:41 -0000 X-Antivirus-MYDOMAIN-Mail-From: bof@bof.de via mars X-Antivirus-MYDOMAIN: 1.25-st-qms (Clear:RC:1(209.85.216.42):. Processed in 0.06944 secs Process 11943) Received: from mail-qa0-f42.google.com (gmail@bof.de@209.85.216.42) by mars.intermailgate.com with RC4-SHA encrypted SMTP; 30 Jan 2014 05:50:41 +0100 Received: by mail-qa0-f42.google.com with SMTP id k4so3838885qaq.29 for ; Wed, 29 Jan 2014 20:50:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=qci1kvv/uTl+a1Q0JrSIuKQbjoaZq1d+QMC0drEll8U=; b=YHzzTK5ggBE0mqeTsb3BDO2UNp12Pndfzuuv8H50jeF+orrsiP7uztJ47D1/cGVtMa m+EHA8/IE7QmeSxXnOMfjbnSTwzeZ3N6W1SkyJV0O3o5MnVoFwi8jv5raxaUPU28Zdrx 411JW+RfqJjPcPG19GU8/YcW64OGS8eLk9KTwSvw8U9kpwTi025WubbqD8fStWC7Wqhz wuSRG6tqENXKonJ2fvUfhrb4pXjGHppRjzmqKgs/ib6bBwjL3NW1ZMa4a75aviyRLddl yYQ14B2vtMXnVkEHQVxCPVn4NpxQVhOFXf6fXHql3WUmDucET3OV5I2a9c5+YHvAvNrd +tHg== MIME-Version: 1.0 X-Received: by 10.229.179.5 with SMTP id bo5mr18479499qcb.21.1391057440112; Wed, 29 Jan 2014 20:50:40 -0800 (PST) Received: by 10.140.94.75 with HTTP; Wed, 29 Jan 2014 20:50:40 -0800 (PST) Received: by 10.140.94.75 with HTTP; Wed, 29 Jan 2014 20:50:40 -0800 (PST) In-Reply-To: <18069656.FoN8fZuO6C@rofl> References: <52E9A631.5050808@sugarcrm.com> <18069656.FoN8fZuO6C@rofl> Date: Thu, 30 Jan 2014 05:50:40 +0100 Message-ID: To: Yasuo Ohgaki Cc: internals Content-Type: multipart/alternative; boundary=001a11c2bcca94a2be04f128ccbc Subject: Re: [PHP-DEV] Re: [VOTE] Introduce session.lock, session.lazy_write and session.lazy_destory From: bof@bof.de (Patrick Schaaf) --001a11c2bcca94a2be04f128ccbc Content-Type: text/plain; charset=ISO-8859-1 > To solve all three problems, I'd suggest > > - unconditional taking of the flock(LOCK_EX) in ps_files_open(), while keeping > the LOCK_UN in PS_READ_FUNC/PS_WRITE_FUNC (if minimize_lock=true). Clarification: unconditionally in case of minimize_lock=true means taking the LOCK_EX after the huge if, right at the end of ps_files_open, i.e. even when data->fd was already >= 0. Otherwise the write case would miss the lock. If that seems strange in ps_files_open then the LOCK_EX could be placed in PS_READ_FUNC and PS_WRITE_FUNC directly after successful call to ps_files_open - doing it that way would have the advantage of making a local code review in each of the functions self-contained wrt the locking. best regards Patrick --001a11c2bcca94a2be04f128ccbc--