Author Topic: Multi threading in VB6 (not multi coring)  (Read 3200 times)

0 Members and 1 Guest are viewing this topic.

Offline Beersatron (OP)

  • Gold Supporter
  • Rear Admiral
  • *****
  • Posts: 996
  • Thanked: 7 times
  • Gold Supporter Gold Supporter : Support the forums with a Gold subscription
Multi threading in VB6 (not multi coring)
« on: December 12, 2011, 09:41:40 AM »
Not sure if Steve already does something like this and also not sure how much work it would be for him to enable it in certain aspects of the code.

I know that VB6 can not be spread amongst multiple cores, but it can run multiple asynchronous threads. Now, how it handles them performance wise is something my very quick google search didn't bring up but I thought I would start a thread since I know there are a few other VB coders on here that may have came across it. I am not a VB coder.

I found this whilst googling.
http://www.vbaccelerator.com/home/VB/Code/Libraries/Threading/Multi-threading_using_classes_in_ActiveX_EXEs/article.asp

Thoughts?

*edit*
To clarify, I am suggesting multi threading in the instances were a function takes a long time to execute, not when a function takes a lot of resources to execute. This of course all depends on the interaction between objects, so you can not have two missile salvos in separate threads since salvo A may affect the result of salvo B.

Hope you get the jist!
« Last Edit: December 12, 2011, 09:45:51 AM by Beersatron »
 

Offline SpecialK

  • Petty Officer
  • **
  • S
  • Posts: 16
Re: Multi threading in VB6 (not multi coring)
« Reply #1 on: January 04, 2012, 07:50:20 PM »
Multi threading is a pain in the butt to code in applications that run in a linear fashion in VB6. In Aurora's case, things happen chronologically. Spreading them out across cores doesn't really work because X happens, then Y happens... and firing off a lot of worker threads to handle that kind of interaction isn't really a good idea because you're working with a single user's perception of time rather than serving multiple snapshots of the state of the database to multiple users.

Basically, the workload is more of an off-line analytical processing workload, and less of an online transaction processing workload. A threaded model and multiple processors makes sense for an OLTP workload, but less so for an OLAP workload.
 

Offline luarvic

  • Leading Rate
  • *
  • l
  • Posts: 14
Re: Multi threading in VB6 (not multi coring)
« Reply #2 on: February 10, 2012, 05:25:37 AM »
But still, if Steve could relocate all time increments calculation code in other process (separated from all the windows) it would be awesome, no freezes, free systems browsing etc. 
God! Why in the world this masterpiece made with stone axe and animal bones?!
 

Offline Erik L

  • Administrator
  • Admiral of the Fleet
  • *****
  • Posts: 5657
  • Thanked: 372 times
  • Forum Admin
  • Discord Username: icehawke
  • 2020 Supporter 2020 Supporter : Donate for 2020
    2022 Supporter 2022 Supporter : Donate for 2022
    Gold Supporter Gold Supporter : Support the forums with a Gold subscription
    2021 Supporter 2021 Supporter : Donate for 2021
Re: Multi threading in VB6 (not multi coring)
« Reply #3 on: February 10, 2012, 11:19:33 AM »
But still, if Steve could relocate all time increments calculation code in other process (separated from all the windows) it would be awesome, no freezes, free systems browsing etc. 
God! Why in the world this masterpiece made with stone axe and animal bones?!

Because it grew out of Starfire Assistant, which was written in VB6. :)

Offline Steve Walmsley

  • Aurora Designer
  • Star Marshal
  • S
  • Posts: 11675
  • Thanked: 20470 times
Re: Multi threading in VB6 (not multi coring)
« Reply #4 on: February 10, 2012, 12:11:35 PM »
But still, if Steve could relocate all time increments calculation code in other process (separated from all the windows) it would be awesome, no freezes, free systems browsing etc. 
God! Why in the world this masterpiece made with stone axe and animal bones?!

http://aurora2.pentarch.org/index.php/topic,2187.0.html

Steve
 

Offline Steve Walmsley

  • Aurora Designer
  • Star Marshal
  • S
  • Posts: 11675
  • Thanked: 20470 times
Re: Multi threading in VB6 (not multi coring)
« Reply #5 on: February 10, 2012, 12:12:21 PM »
Because it grew out of Starfire Assistant, which was written in VB6. :)

SA started off in VB3, which was the current version of VB at the time. It was changed to VB4, VB5 and VB6 over time. VB.NET was just too different though to update from VB6.

Steve
 

Offline luarvic

  • Leading Rate
  • *
  • l
  • Posts: 14
Re: Multi threading in VB6 (not multi coring)
« Reply #6 on: February 10, 2012, 05:09:47 PM »
Quote from: Steve Walmsley link=topic=4462. msg46464#msg46464 date=1328897495
hxxp: aurora2. pentarch. org/index. php/topic,2187. 0. html
Steve
Yea, im got it, im a programmer too, and im using Delphi7, thus i know its old, but it has anything i need right there where i need it to be. 

But, Steve, think about making api for Aurora, im talking about possibility to create separate application thats will manage all user interface, graphics and game controls. 
For instance how it can be done: Aurora has command line key "Aurora. exe -doprocess -gamename -timeincrement", and when it used, Aurora runs, processes all game world how its happens now, and then closes.  The separate application will get all game data that player needs from other data base created by Aurora during processing.  All player's changes, orders, etc are placing in another DB by that program, then player presses button "5 days" in his new cool looking 3D Aurora client, then its creating DB with orders and runs Aurora with key "doprocess".
This way you will never bother again with game interface, translation, graphics, all what you will need to do is update DB's structures, and third party programmers (like me) will care the rest of "dirty work".
Just think about the possibilities
 

Offline ollobrains

  • Commander
  • *********
  • o
  • Posts: 380
Re: Multi threading in VB6 (not multi coring)
« Reply #7 on: February 15, 2012, 02:57:47 PM »
i wonder if the api approach works seems to work for python language programming
 

Offline luarvic

  • Leading Rate
  • *
  • l
  • Posts: 14
Re: Multi threading in VB6 (not multi coring)
« Reply #8 on: February 16, 2012, 12:21:32 AM »
i wonder if the api approach works seems to work for python language programming
if it allows to read/write files, then yes
 

Offline ollobrains

  • Commander
  • *********
  • o
  • Posts: 380
Re: Multi threading in VB6 (not multi coring)
« Reply #9 on: February 18, 2012, 04:16:22 AM »
i was just thinking ive read about it being used elsewhere on simliiar c programmed games ah well i guess it might come in useful