From mboxrd@z Thu Jan 1 00:00:00 1970 From: john at keeping.me.uk (John Keeping) Date: Thu, 16 Jan 2014 22:20:22 +0000 Subject: Policy on global variables In-Reply-To: References: <20140116104751.GA26678@dcvr.yhbt.net> <20140116130844.GF7608@serenity.lan> <20140116212152.GH7608@serenity.lan> <20140116213424.GI7608@serenity.lan> Message-ID: <20140116222022.GJ7608@serenity.lan> On Thu, Jan 16, 2014 at 10:36:34PM +0100, Jason A. Donenfeld wrote: > On Thu, Jan 16, 2014 at 10:34 PM, John Keeping wrote: > > > > I'm not sure it makes much difference either way. Even if we use > > libgit2, providing we're not processing more than one request at once we > > can still use a global cgit_context. > > Well, the idea of moving to libgit2, in the first place, would be to > benefit from its reentrancy, so that we could process multiple > requests at once (potentially). At once (as in in parallel), or without needing to fork for every request? I think that many requests serially in the same process is a much more likely scenario (that's what FastCGI does); in that case all we need to do is clean up after each request and it doesn't make much difference if that state is global or passed down through the functions that need it.