From: hjemli at gmail.com (Lars Hjemli)
Subject: Policy on global variables
Date: Thu, 16 Jan 2014 09:06:51 +0100 [thread overview]
Message-ID: <CAFXTnz47EV_xFnz_7oNRZzeqaAWq6E0LcJFmmiy502TQ3KpTUA@mail.gmail.com> (raw)
In-Reply-To: <CAHmME9qWGtso5o+ao0FpsaVO_3ZoRbwoOK1G3Tp2aWtsD0iF2w@mail.gmail.com>
On Thu, Jan 16, 2014 at 2:00 AM, Jason A. Donenfeld <Jason at zx2c4.com> wrote:
> On Thu, Jan 16, 2014 at 1:59 AM, Eric Wong <normalperson at yhbt.net> wrote:
>> This. I prefer we keep passing around the ctx variable to keep the code
>> more flexible for future reuse. Of course, IIRC git itself has this
>> limitation, too...
>
> Can anyone confirm or deny this? Is it a pointless endeavor because of
> git's design?
Supporting something like FCGI in cgit will require a fork(2) for each
request, before invoking libgit.a functions, since these functions are
not generally reentrant (they tend to use global state and/or
inconveniently die(3)).
Therefore, passing a pointer to a context variable serves no real
purpose since each request would be processed in a different child
process (thus having a private copy of the global context).
But FCGI support could still be a nice addition to cgit, since parsing
of cgitrc and/or scanning for repos could then be done once, in the
parent process.
--
larsh
next prev parent reply other threads:[~2014-01-16 8:06 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-16 0:06 Jason
2014-01-16 0:20 ` Jason
2014-01-16 0:59 ` normalperson
2014-01-16 1:00 ` Jason
2014-01-16 8:06 ` hjemli [this message]
2014-01-16 10:47 ` normalperson
2014-01-16 11:31 ` Jason
2014-01-16 13:08 ` john
2014-01-16 18:38 ` Jason
2014-01-16 21:21 ` john
2014-01-16 21:26 ` Jason
2014-01-16 21:34 ` john
2014-01-16 21:36 ` Jason
2014-01-16 22:20 ` john
2014-01-16 23:42 ` Jason
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAFXTnz47EV_xFnz_7oNRZzeqaAWq6E0LcJFmmiy502TQ3KpTUA@mail.gmail.com \
--to=cgit@lists.zx2c4.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).