lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Harwood <markharw...@yahoo.co.uk>
Subject Re: Improving TimeLimitedCollector
Date Sat, 27 Jun 2009 17:19:17 GMT
Odd. I see you're responding to a message from Shai I didn't get. Some  
mail being dropped somewhere along the line..

> Why don't you use Thread.interrupt(), .isInterrupted() ?


Not sure where exactly you mean for that?

>>
>> I'm not sure I understand that - how can a thread run >1 activity
>> simultaneously anyway, and how's your impl in  
>> TimeLimitingIndexReader allows
>> it to do so?


I can have a single thread performing using multiple readers/writers  
and each reader/writer has different timed activities e.g.


reader1.startActivity(60000)
try
      do reader 1 stuff....
      reader2.startActivity(10000);
      try
          do reader 2 stuff.....

      finally
          reader2.endActivity();


finally
    reader1.endActivity();

Each reader has it's own list of threads and their anticipated  
timeouts in relation to that particular resource.


Bit of an edge case perhaps but anything based on statics precludes  
this type of code. An instance of a timeout object would give this  
flexibility but as you say - you would need to pass a timeoutable- 
activity context object around which is a bit more hassle. Flexibility  
vs simplicity decision to be made here.

>>
>> I don't mind working on that w/ you, if you want.


Appreciated. I'll move the timeout management logic out of reader into  
another class and open a Jira issue so we can move the discussion/ 
development there.

Cheers
Mark
Mime
View raw message