[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform] how to control job worker thread

Hi

Is there any way to use the Eclipse job API and force it always uses the same worker thread, or a thread of my choosing?

To explain my problem:
I'm having trouble with my eclipse jobs, as I need to make sure, they're all run on a specific thread, or at least
always on the same thread.

Why do I need this?
Well I use JNA to access a native application. The access is actually implemented by a 3rd-party project. Using this
projects API I create an instance of an "Engine" object in my code, that uses JNA to act as a facade to the native
application (its a numerical engine called "Matlab"). I use this to do expensive computations, so I really, really HAVE
to do it with a job or separate thread of my own.

The problem is that I can only work with this JNA engine instance from the same thread where it was created.
Following the tutorial "On the Job" and other documentation I use jobs when accessing this engine.
Eclipse assigns different worker threads to my jobs (at will, as its probably supposed to do).
Right now I have little control over the 3rd-party code. It is open source, but I don't understand JNA well enough to
fix it (I already contacted the author though). So even if it is a bug on behalf of this project, I probably have to
work around it on my side.

To repeat the question:
Is there any way to use the Eclipse job API and force it always uses the same worker thread, or a thread of my choosing?
Or: Is there another way to spawn background processes with a nice Eclipse progress dialog and job completion
notification that doesn't use this random worker pool?

Thx very much for any ideas
Norbert Schoepke