|
-
May 9th, 2019, 08:10 PM
#11
Thread Starter
Member
Re: [ADVANCED] Multi-threaded VB6
@ Zvoni, I have referenced the objects. Problem is as soon as one accesses the other, it deadlocks until the thread accessed is finished. Yes, the main thread has its own apartment, and the FindWindow code is so that two forms don't get loaded. VB actually calls sub main twice when multi-threading, and only once in IDE/non-multi...
@ qvb6, update memory, call procedure, anything to update the thread from the other. Thread A is the main thread, though it doesn't seem to make a difference if I purposely lock thread A and try to update memory with B or B and update it with A. EXE is not used by another EXE. I am NOT using WaitForSingleObject(), never heard of it.
@ vbwins / wqweto, why is it not subject to marshaling? But yes, that is what I am looking for. Can I do that without storing in a database? I need a non-blocking queue to pass events. The main thread has my GUI and the second has a web server that could be busy downloading pictures/video. The web server has to pass limited data to the GUI to change screens / info. True the GUI shouldn't be that busy that it deadlocks the web server while its trying to update, it just seems like the best way to write it is with a non-blocking queue. MS documentation says that raisevent should be non-blocking if picked up by another thread, but it doesn't seem to work for me.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|