#447 Finish conversion of WorkRequest users to Task API


Okay, I don't known when I'll find time the next days. So attached the second patch of the conversion described in patch tracker https://sourceforge.net/tracker/?func=detail&aid=3556968&group_id=588&atid=300588.

Attached patch converts all WorkRequest users to the Task API.

An open and still untested problem/point is the abortion or cancelation of a "IOTask". But you will get the idea of the conversion. Please have a look and give me feedback.


  • Thomas Meyer

    Thomas Meyer - 2012-08-16

    Rebased on step1-v4 and several fixes.

  • Alan Ezust

    Alan Ezust - 2012-08-17

    For WorkThreadPool.java, it was marked deprecated before your changes, and now that you've rewritten the class, is it still deprecated? Shouldn't the API docs/@deprecated stuff be updated too?

  • Thomas Meyer

    Thomas Meyer - 2012-08-21

    Yes and no! After this patch (step 2) the WorkThreadPool class is used to implement a queue for Tasks/Runnables to run in the AWT-EventQueue-Thread after all pending IO-Tasks are finished. Maybe a third step is necessary to move this AWT task queue (and resp. functionality) to the TaskManager class.

    This step 3 should also get rid of the IOProgressMonitor class.

    So in the long run we should get rid of the WorkThreadPool class.

    And yes, when a final form is found, the API docs/@deprecated stuff should be updated.

  • Alan Ezust

    Alan Ezust - 2012-08-22
    • status: open --> open-works-for-me
  • Alan Ezust

    Alan Ezust - 2012-08-22

    Testing your 2 patches now and it works great!! I will keep testing for another couple of days before either I or matthieu commits it.

  • Thomas Meyer

    Thomas Meyer - 2012-08-22

    Yes, they should work :-)

    Two things I want to point out:
    - Like I already wrote: I'm not sure what to do with the old abort() mechanism. The best thing would be to convert all users to use a race safe interrupt() mechanism. But it should mostly work in the current implemention.
    - The IO tasks submitted by the Hyperserach uses temporary buffers. These temporary buffers submit their IO task to the current thread and are not submitted via ThreadUtilites helper class and their for you cannot see these tasks in the task manager docklet. I'm not sure what to do with this optimization.

  • Alan Ezust

    Alan Ezust - 2012-08-22
    • assigned_to: nobody --> ezust
  • Thomas Meyer

    Thomas Meyer - 2012-08-23

    New version of the patch attached.
    - I screwed up the waiting of the queue AWT thread in TaskManager.waitForIoTasks(). We really wait now for the queued AWT task to finish.

  • Thomas Meyer

    Thomas Meyer - 2012-08-25

    Updates patch attached.
    The new patch uses Thread.interrupted() for Cancellation of a Task and gets rid of the Abort mechanism.

  • Thomas Meyer

    Thomas Meyer - 2012-08-27

    Rebased and I think I found a bug in the Task class. the "thread" attribute has to be volatile, without it I can't see how the cancel() method should work correctly!

  • Alan Ezust

    Alan Ezust - 2012-09-02
    • assigned_to: ezust --> thomasmey
  • Thomas Meyer

    Thomas Meyer - 2012-09-05
    • status: open-works-for-me --> closed-works-for-me

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks