Having some trouble Threads in VB.NET

SelArom

Senior member
Sep 28, 2004
872
0
0
www.djselarom.com
Okay I'm trying to make a simulation of the round robin thread, and I have a list class of incoming processes. I want to raise an event when it's time for the process to come in, and handle that event in the windows form code to create and add a list item to a box. I've used the invoke method on the callback to add the item to the box but it still insists it's not on the right thread. I'm farily new to multithreaded programming (in fact that's why I'm doing this, to learn!) but I just can't figure this one out. my code is below, any thoughts?

thanks
-SelArom
 

SelArom

Senior member
Sep 28, 2004
872
0
0
www.djselarom.com
staring at my code for a while I think I've got an idea: it seems that the thread running the processlist procedure is the one that is also running the event handler! is that right? how do I make it not do that? that is, how do i give control of the handler to the windows form thread rather than the one I spawned to process the list?

-SelArom