backgroundWorker & thread example..

Posted by kartikvbn on 06-Mar-2009 04:33

hi all,

i am try backgroundWorker but with gui this is not support properly.

When i run that screen to show take (500 * 5) millisecond. and all 5 desktop alert show one time.

I try like That..

USING System.Threading.*.

CONSTRUCTOR PUBLIC main ( ):

SUPER().

InitializeComponent().

backgroundworker1:RunWorkerAsync().

......

..

METHOD PRIVATE VOID backgroundWorker1_DoWork( INPUT sender AS System.Object, INPUT e AS System.ComponentModel.DoWorkEventArgs ):

DEFINE VARIABLE iLoop AS INTEGER NO-UNDO.

DO iLoop = 1 TO 5:

Thread:Sleep(500).

ultraDesktopAlert1:Show("Manish","Bansal").

END.

RETURN.

END METHOD.

Thanks and regards

Kartikeya Sharma

All Replies

Posted by Admin on 06-Mar-2009 05:58

Hi,

the use of threads won't work. The Progress runtime is single threaded (that's also documented).

Further more the use of threads in OpenEdge 10.2A is not PERMITTED (violating the EULA).

In a long running process, you might use the PROCESS EVENTS statement to get event processed. But that will only work, if the client is busy (and not waiting for the Database or an AppServer request to finish).

Mike

Posted by rbf on 06-Mar-2009 06:55

I have always been aware of this, but why did PSC put the BackgroundWorker in the toolbox that they supply? Can it be used at all?

And at the same time, essential controls such as the Splitter are not in the toolbox by default.

Inquisitive minds would like to know.

Posted by Peter Judge on 06-Mar-2009 08:12

I have always been aware of this, but why did PSC put

the BackgroundWorker in the toolbox that they supply?

It's a known/logged bug - BackgroundWorker should not appear in the toolbox.

And at the same time, essential controls such as the

Splitter are not in the toolbox by default.

Please log this with TS.

Inquisitive minds would like to know.

-- peter

Posted by Thomas Mercer-Hursh on 06-Mar-2009 10:58

It's a known/logged bug - BackgroundWorker should not appear in the toolbox.

Alternatively, one could make the AVM multithreaded!

This thread is closed