From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS14383 205.234.109.0/24 X-Spam-Status: No, score=-0.5 required=5.0 tests=AWL,FREEMAIL_FROM, MSGID_FROM_MTA_HEADER,RP_MATCHES_RCVD,T_DKIM_INVALID shortcircuit=no autolearn=unavailable version=3.3.2 Path: news.gmane.org!not-for-mail From: Jimmy Soho Newsgroups: gmane.comp.lang.ruby.unicorn.general Subject: Re: Thread.current Date: Wed, 12 Jan 2011 09:52:12 +1100 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1294786857 10862 80.91.229.12 (11 Jan 2011 23:00:57 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 11 Jan 2011 23:00:57 +0000 (UTC) To: unicorn list Original-X-From: mongrel-unicorn-bounces@rubyforge.org Wed Jan 12 00:00:53 2011 Return-path: Envelope-to: gclrug-mongrel-unicorn@m.gmane.org X-Original-To: mongrel-unicorn@rubyforge.org Delivered-To: mongrel-unicorn@rubyforge.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=BJC9kzUFkFs1iB5F96F9+lLyvvTTQGOxan7E1iiQXi4=; b=r9aRQys1xLE2bOkCbPWFL2rtRpjQt18/tZSo5zRUaw/8PBOwHXgWGcstwkO0kv7vL2 8Bz12W4y2C34oZ/RmbMeDZKvBc8ZmOvAAwoNYSpeFnVxtMFOBkJ4pIzBhnkPSb1d833o cEwiP08nk10PnpmYv3VEpBZgNHkONmASk2Y2g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=I3rjunkt8I2r5kVBP+fsa4/zKXy+jjb/Braq4e6Dtp5TdwiJNTW8ztPRDAqMLkVOfh J7tR8oPSJCQWk2BKhvmzm7sqb7aprTQ/lm1gikwwPVHyxG6M2TaK2FrYQ8D/O4/xlvHL 44YGG4BNlLgGXvy8UiHTzpX1WIB7fGrf/hmgY= In-Reply-To: X-BeenThere: mongrel-unicorn@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: mongrel-unicorn-bounces@rubyforge.org Errors-To: mongrel-unicorn-bounces@rubyforge.org Xref: news.gmane.org gmane.comp.lang.ruby.unicorn.general:813 Archived-At: Received: from rubyforge.org ([205.234.109.19]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PcnCt-00034Y-7g for gclrug-mongrel-unicorn@m.gmane.org; Wed, 12 Jan 2011 00:00:51 +0100 Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 5171F1858385; Tue, 11 Jan 2011 18:00:50 -0500 (EST) Received: from mail-qw0-f50.google.com (mail-qw0-f50.google.com [209.85.216.50]) by rubyforge.org (Postfix) with ESMTP id AB7C1185837B for ; Tue, 11 Jan 2011 17:52:12 -0500 (EST) Received: by qwd6 with SMTP id 6so21723438qwd.23 for ; Tue, 11 Jan 2011 14:52:12 -0800 (PST) Received: by 10.229.189.194 with SMTP id df2mr142865qcb.232.1294786332403; Tue, 11 Jan 2011 14:52:12 -0800 (PST) Received: by 10.229.216.148 with HTTP; Tue, 11 Jan 2011 14:52:12 -0800 (PST) Hi, Some more questions still: It seems a worker uses the exact same thread to handle each request. Is that guaranteed to happen for the lifetime of a worker? Or are there cases where a unicorn worker might spin a new thread to handle the next requests? If the same thread is always used, isn't that a potential issue when programmers use thread local variables, which are not reset at the next request? (I know, the usage of thread local variables is not recommended, but take a random rails project, go into their $GEM_HOME and do grep -r Thread.current . , see what I mean..) Cheers, Jimmy On Sat, Jan 8, 2011 at 4:54 PM, Jimmy Soho wrote: >>>> However, the Thread.current value within those parallel requests is >>>> always the same. > > EW> Just a lucky coincidence :) > > I guess. Got confused there for a moment because of it. :) =A0Using $$ > made things more clear. > > > > Thanks > > Jimmy > _______________________________________________ Unicorn mailing list - mongrel-unicorn@rubyforge.org http://rubyforge.org/mailman/listinfo/mongrel-unicorn Do not quote signatures (like this one) or top post when replying