Quantcast
Channel: ClearScript
Viewing all articles
Browse latest Browse all 2297

New Post: problem with backgroundworker

0
0
On second thought maybe it didn't "bomb", i.e. generate a run time error, since my error trapping didn't trap anything. Instead I think it ran the line

WorkflowVBS.Dispatcher.Invoke(new Action(() => WorkflowVBS.ExecuteCommand(WF.SCEvent_Names[Index])));

and just hanged. Is that possible?

On the calling thread I used System.Threading.AutoResetEvent. WaitOne and Set to block until the background worker thread completed. Any other suggestion?

I got past it by rewriting the windows program as a single thread since it runs from a command line. 90% of the time code calling scripting will be single thread and if not it will be called in a separate thread to keep the GUI alive. I will be using a lot of command line and service programs so I am very concerned that the scripting code will not run in those environments if I use multi threads.

I will admit I am a noob to multithreading in C# or any other language. Your statement "you'll have to come up with your own way to ensure that the script engine is accessed only on that thread." may as well be in pig latin to my understanding. To my knowledge there are only 2 threads, the calling and the backgroundworker.

I assume this scenario also applies to the microsoft javascript. Does it apply to the V8 engine also?

Give me a clue and a homework assignment kind sir. I am appreciative of your assistance.

Viewing all articles
Browse latest Browse all 2297

Latest Images

Trending Articles





Latest Images