Return-Path: Delivered-To: apmail-incubator-uima-user-archive@locus.apache.org Received: (qmail 86654 invoked from network); 12 Nov 2007 16:12:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Nov 2007 16:12:58 -0000 Received: (qmail 314 invoked by uid 500); 12 Nov 2007 16:12:39 -0000 Delivered-To: apmail-incubator-uima-user-archive@incubator.apache.org Received: (qmail 294 invoked by uid 500); 12 Nov 2007 16:12:39 -0000 Mailing-List: contact uima-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: uima-user@incubator.apache.org Delivered-To: mailing list uima-user@incubator.apache.org Received: (qmail 281 invoked by uid 99); 12 Nov 2007 16:12:39 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Nov 2007 08:12:39 -0800 X-ASF-Spam-Status: No, hits=-4.0 required=10.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [128.115.41.83] (HELO smtp.llnl.gov) (128.115.41.83) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Nov 2007 16:12:42 +0000 X-Attachments: None X-IronPort-AV: E=Sophos;i="4.21,405,1188802800"; d="scan'208";a="19997539" Received: from suppe2pd.llnl.gov ([134.9.250.132]) by smtp.llnl.gov with ESMTP; 12 Nov 2007 08:12:21 -0800 Message-Id: <6.2.1.2.2.20071112080719.02eec988@mail.llnl.gov> X-Mailer: QUALCOMM Windows Eudora Version 6.2.1.2 Date: Mon, 12 Nov 2007 08:12:20 -0800 To: uima-user@incubator.apache.org,uima-user@incubator.apache.org From: Steve Suppe Subject: Re: (one other) Multithreading question In-Reply-To: <4738425F.5040600@schor.com> References: <4738111D.2030102@michael-baessler.de> <4738425F.5040600@schor.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Virus-Checked: Checked by ClamAV on apache.org A slightly different (but related question): I've been playing around with this type of computation. We are loading data into a DB. We have a small Linux cluster (15 multi-core nodes at the moment) that we have scaled up to run 224+ instances of our pipeline. I've noticed for most of our calculations, it's really Oracle that is holding us back. In some instances, a 'computation' is classified as one 'medium to long' data pull from Oracle, a bunch of analysis, and then 'small to large' insertions of results. I've dabbled in placing static DB connections and mutexes through the code to guarantee that the instances on a machine only access the DB one at a time, but are free to run analysis simultaneously otherwise. I have also toyed with the idea of locks that allow N number of connections (instead of only the mutual exclusion one at a time) so that I can increase the connections to a point, but not overload the system. Has anyone tried anything like this? Or is anyone else at least running a similar hardware set-up? It would be great to compare note. Thanks, Steve At 04:09 AM 11/12/2007, Marshall Schor wrote: >This may not be quite precise enough. Your Annotators will be >instantiated multiple times, so that a single *instance* of an >annotator will not be run on multiple threads at once. So - if you have >non-static fields in your annotator, they do not need to be accessed >with threading in mind. But if you make use of "static" fields, there is >only one instance of these, so access to them must be thread-safe. > >If your *application* (not your annotator) is multi-threaded, it will >need to be thread-safe. You can find relevant information about this in >the tutorial and reference docs for UIMA (search for "thread"). > >-Marshall > >Michael Baessler wrote: > > Benjamin Sznajder wrote: > >> Hi all, > >> > >> I am interested in using multi-threading in UIMA. > >> My aim is that the flow runs several annotators in parallel. > >> One of my annotators is not thread-safe. My question is, then, > >> Does the UIMA parallelism ( setting "MultipleDeployment=true") requires > >> that annotators on which this flag is set, are thread-safe? > >> > >> Regards, > >> Benjamin. > >> > >> > > Yes, your annotator have to be thread-safe when you want to run them > > multi-threaded. > > > > -- Michael > > > >