Multiple "Threads"

Blitz3D Forums/Blitz3D Beginners Area/Multiple "Threads"

BMA(Posted 2005) [#1]
Hi,

is it possible to create multiple threads, which run independent from each other like you could do it in Java?

I have to connect to an internet server and wait for the server's answer. Now if I put the server call in the app's main loop and the server response is very slow, the whole execution of the app is halted until the message arrives, isn't it?

How could it be done polling a server without affecting the app /game's rendering?

Thanks


GitTech(Posted 2005) [#2]
Nopez, Blitz3D doesn't support threads.


Xaron(Posted 2005) [#3]
I use C++ for the server and Blitz3D for the client because of this...

Regards - Xaron


RepeatUntil(Posted 2005) [#4]
Or you could use a dll which uses thread (in C++, or Purebasic, etc)


Neochrome(Posted 2005) [#5]
that could be handy!
could be interesting on how to make a dll execute parts of the blitz code.

theory here,
thread1% = calldll("createthread.dll", "code.bb")

RunThread(thread1%)
StopThread(thread1%)



if someone could work out someting like that, blitz 3D would have an advancement just by doing that, i would LOVE to make a loading sequence or animated mesh while the level is loading!


Damien Sturdy(Posted 2005) [#6]
Would it be difficult to access an image and frontbuffer from a DLL? You could have a DLL in a seperate thread which updates an image drawn to the screen :)


Kev(Posted 2005) [#7]
@Neomancer, how would you compile the .bb?

@Cygnus, you could pass the blitz internal image structure find the offset to the raw image data. modify it from there, it might work.


Damien Sturdy(Posted 2005) [#8]

Apparently it ripped through the town centre, and caused 5m pounds worth of improvements.



It would work. it's been done, however, its the accessing of the frontbuffer thats key to seeing these updates, and that hasn't been done yet :)


Neochrome(Posted 2005) [#9]
@Kev, if it was possible, but i guess your right, i didn't think about that!