Multithreading
BlitzMax Forums/BlitzMax Programming/Multithreading
| ||
Hey guys, I was wondering if there is a way to utilize multithreading in Blitz Max, and if there is, is it a mod, or is it already in Blitz Max? |
| ||
It's already built in. Works fairly well, with some limitations -- for example, you can only draw to the screen from the main program thread, the drawing commands aren't thread-safe. You can use most of the other commands in different threads, though. (game logic, network communications, etc.) |
| ||
Ok, cool. How do I use it, could you give me an example? |
| ||
example will be welcomed .. here as well |
| ||
I found a sample on multithreading, which is at the bottom of the samples list. REMEMBER TO RUN ON THREADED BUILD! |
| ||
I also found an example in the blitz max docs (not the manual on the website). Here's the example on the Blitz Max docs: And here's the sample in the samples folder: Hope this helps anyone else! |
| ||
thanks it does |
| ||
I realized that this only works when threaded build is on. Is there a way to change this? Because I want to give people my games just as an exe, not a .mt.exe file. |
| ||
Just remove the .mt, it has no bearing on how the file is executed. I guess its just there so you can tell the compiled binaries apart. |
| ||
Oh... Stupid question :) |