Remember that because it randomly selects test data, the number of
Callabes will changes from run to run.

The only scenario in which I can reproduce this is the case in which
the Callable throws an Exception. That should stop the whole process,
but, actually the isDone() thing prevents it from being detected in
many cases, since it prevents get() from being called.

It's not that the Callable isn't called, or continues running later,
or otherwise starts but doesn't finish.

I'll remove isDone() since that's more correct. For me it works either
way though -- if no exception occurs. I used counters to double-check
the number of results was as expected.

On Fri, Sep 24, 2010 at 7:15 AM, Sean Owen <[email protected]> wrote:
> The logic seems OK to me. invokeAll() kicks off all the Callables. It
> waits for all to finish on account of the calls to get(), which block
> until a result is ready. I think the isDone() call is redundant indeed
> but shouldn't hurt -- get() isn't called in the case that it's already
> done.
>
> Nevertheless I'll try to reproduce this.
>
> On Fri, Sep 24, 2010 at 1:50 AM, Stanley Ipkiss <[email protected]> 
> wrote:
>>
>> For the class PreferenceEstimateCallable, the parent thread does not wait for
>> all the child threads of this class to complete. On just adding a few simple
>> log statements around the call() function (shown below), I have observed
>> that there were a lot more "Starting" (622 in number) as compared to
>> "Stopping" (1 in number) in my logfile. I ran it multiple times and
>> everytime I got some difference in the total number of logged start and
>> stop. I will try to fix this issue in my checked out code, but just wanted
>> to know if anyone else has noted this?
>>
>>   public Void call() throws TasteException {
>>      log.info("Starting - analysis for pref size:" + prefs.length());
>>      for (Preference realPref : prefs) {
>>        ....
>>      }
>>      log.info("Stopping - analysis for pref size:" + prefs.length());
>>      return null;
>>    }
>>
>> --
>> View this message in context: 
>> http://lucene.472066.n3.nabble.com/Possible-multi-thread-issue-in-AbstractDifferenceRecommenderEvaluator-tp1571411p1571411.html
>> Sent from the Mahout User List mailing list archive at Nabble.com.
>>
>

Reply via email to