The porter mail thread had a number of conversations about threading and resource issues you may find useful. The threading model in River is quite old and will certainly benefit from a good refactoring.
+1 Peter. ----- Original message ----- > On 6/26/2011 3:18 PM, Peter Firmstone wrote: > > > > > I think the way to look at this is to examine the non-trivial runAfter > > > implementations. If they have common elements that can be helped by some > > > utility classes, write those classes. If not, deal with each > > > individually. > > > > > > We are now committed to 1.5, so if we did not have runAfter we could > > > replace TaskManager with java.util.concurrent.ThreadPoolExecutor. > > > > That's probably where we should be headed, since it reduces our > > maintenance burden. > > It's also a direction that suggests an easy step-wise route from here to > there. I propose to start replacing TaskManager uses with > ThreadPoolExecutor, one at a time. I can begin with the easy ones, and > gradually work up to the most complicated cases. > > Patricia