java - Why Object#wait is not a "reasonable opportunity" for Display.asyncExec or Display.asyncExec? -


I am reading Excel file, then I am trying to show progress, I share the object that contains the maximum line number And the last line number is read. Every 150 lines I save the value in my object, I wait for it and my reading stops until the object is unlocked.

In my dialogue window I use syncExec or asyncExec methods with values ​​within the ProgressBar object. And the method is open only after calling the methods.

I know that those methods are waiting for the most suitable "suitable" opportunity to run there. Even though I do not understand, why is not it, if those methods are not run, when they do not go anywhere?

My actual position is that asyncExec updates ProgressBar only at the end of the reading process and synExec hangs the application because the object # is waiting because it can not be executed.

Thanks for reading and answering more thanks.

The next fair opportunity occurs when your runnab reaches the head of the event loop queue event loop every Time runs while waiting in Runnables. I suspect you are stopping the thread of the event loop.

Comments