Ant's Threads ?

BlitzMax Forums/BlitzMax Programming/Ant's Threads ?

Paul "Taiphoz"(Posted 2005) [#1]
1st, where did the thread go ?
2nd, Will it be getting added to max via syncmods ?


{cYan|de}(Posted 2005) [#2]
will what be getting added o_O


Wiebo(Posted 2005) [#3]
1. what tread?
2. do you mean modules made by Antony? I doubt it as he does not work for brl (and those modules will probably remain in beta or unfinished anyway).


AdrianT(Posted 2005) [#4]
heh, don't know. We allmost made a game with ants mods allready. Probably be finished in March :) So far its going very well and our sports game runs at 55fps even on his old P2 350 he's currently using. Been pretty impressed with it so far, particularly when it has a proper B3D loader this time thats about 80% complete. could do with some extra UV'e exported from pipeline though.


Paul "Taiphoz"(Posted 2005) [#5]
I'm talking about the mod that Anotny and co did to allow threading in Max, I thought everyone seen that post.

Anyway I was wondering if Mark/BRL would be adding it into the official mods list, seems really silly if its not, after all it is a function that a lot of people have asked for.

Anyway had to format PC and lost some key files I wanted to keep, so I'm looking for the thread about the erm threads lol.


AdrianT(Posted 2005) [#6]
heh, I doubt it Yavin, I was under the impression that Mark wasn't convinced it was stable enough and wouldn't cause more problems that it was worth. Apparently there are a lot of issues with handling threads that make it very hard to implement properly. Don't remember the details and I'm not a prog so I'll shut up now :)

good luck with the threading :)


AntonyWells(Posted 2005) [#7]
It's still in the showcase
http://www.blitzmax.com/Community/posts.php?topic=42310.

Kinda got pushed back when they merged with the b3d forums.


Btw, evak, stop teasing and post 'em a shot :)


Warren(Posted 2005) [#8]
Anyway I was wondering if Mark/BRL would be adding it into the official mods list, seems really silly if its not, after all it is a function that a lot of people have asked for.

Mark posted in that thread saying that he didn't think it was a good idea and probably wouldn't be adding it to the language.


AntonyWells(Posted 2005) [#9]
If mark thinks threads are not a good idea mark is wrong. (Just about any app you use makes use of them..windows included.)

Whether he has wrote a language capable of using them is another matter all together although in tests i've done, bmax runs flawlessly with them.
If mark wants to post examples of them not working, I'd happily acknowledge the problem...


AdrianT(Posted 2005) [#10]
heh, well easy solution to the problem is to just use it and see what happens.

I'll probably post a screenshot soon, when I'm happy with how the game looks, its a bit messed up at the moment as the robot's lying on his side in the gamepad build I have now heh. And the level should improve quite a lot in the coming days :) noticed Anti Aliasing doesn't work with Bmax at the moment either unless I have one of the crap beta drivers installed at the moment.


Warren(Posted 2005) [#11]
heh, well easy solution to the problem is to just use it and see what happens.

Yeah, I mean, feel free to use threads but don't be surprised when your users are reporting weird, hard to reproduce bugs.

I'm writing a C++/Windows application right now that seems to be in the perfect spot to use threading. I almost started coding them in and a voice in the back of my head said, "Why not use idle time instead?" So I'm backing away from the threads and am going to manually do the processing in idle time (WM_IDLE).

Don't use them unless you are absolutely confident that you know what you're doing. But I know that will fall on deaf ears, so enjoy!


John Pickford(Posted 2005) [#12]
I can't see Brl introducing any feature which is specific to Windows at this stage. Currently code written in Max + Official Mods is cross compatible and I expect that to remain.


AdrianT(Posted 2005) [#13]
I agree with John myself as cross platform compatibility is one of the BIG selling points. Would be nice to have some kind of GUI system that worked on all platforms too


AntonyWells(Posted 2005) [#14]
Threads are possible on mac/linux too(98% sure of that). It would be a day's work to add mac/linux support if you had access to those versions of bmax and it's at all like windows api. it's probably easier..


marksibly(Posted 2005) [#15]
Threads are great etc, but as I said before there are sections of code in Max that will *not* multithread nicely and need some kind of locking mechanism.

99.99% of the time there will be no apparent problems. It's only when a thread switch occurs at a precise point in the code that something will go wonky.

I am definitely interested in adding threading in the future, but I believe it will require some language additions to be efficient/practical.


Paul "Taiphoz"(Posted 2005) [#16]
Thanks for the reply antony, Ill dig them back out and burn them to CD so I dont lose em..

@ Mark, thanks for the post, Just wana say the Max kicks ass, but hay you already know that, on the threading issue I'm glad that your really going to think about adding BRL support for them at some stage.

Nice work all.


AntonyWells(Posted 2005) [#17]

Threads are great etc, but as I said before there are sections of code in Max that will *not* multithread nicely and need some kind of locking mechanism.

99.99% of the time there will be no apparent problems. It's only when a thread switch occurs at a precise point in the code that something will go wonky.

I am definitely interested in adding threading in the future, but I believe it will require some language additions to be efficient/practical.



Did you smack John over the head and steal his account? I swear his name was on this post for ages....I read Yavin's reply and......Umm..seriously confused now...another dirkduck? :)

Anyway, mark I'm not saying threads are going to work with every BRL module, as obviously any that use unreachable(I.e unlockable) resources will eventually mess up,
my point is whoever wants to use them, if they *don't* blindly walk into it with a big 'what's going on here then grin' look on there face, they can manage the downsides and come out on top. Like rambo...


Warren(Posted 2005) [#18]
Right, so not appropriate for a basic dialect language. Thanks!

I will have to admit though that I did switch to using a thread for the app I mentioned earlier. The background processing didn't pack enough punch to make it happen. The app was jerky and while it did respond while the background stuff was running, it had constant hiccups and stumbles. *sigh*

The processing going on in the thread is perfectly self contained, however, so it's not all that scary. That, and I'm using MFC so Microsoft's code is taking care of most of the scary details like preserving process states and such.


AntonyWells(Posted 2005) [#19]
Right, so not appropriate for a basic dialect language. Thanks!


Name me one other coding feature you need to dress up with war paint on your face before using?
Name one other feature that's use often ends in someone screaming 'Medic!' or 'Mother' if you're buster.
For that alone, I'll use them to the day I..well, since we're being honest,I've not used them at all for the game.
No cross-platform = no go, even for me, but Mark could sweet and(and sour 'Threads. But one at a time') that.

As for your app's performance Warren, try throwing a delay 10 or similar(in looped threads anyway). I had to do the same.


Warren(Posted 2005) [#20]
Name me one other coding feature you need to dress up with war paint on your face before using?
Name one other feature that's use often ends in someone screaming 'Medic!' or 'Mother' if you're buster.
For that alone, I'll use them to the day I..well, since we're being honest,I've not used them at all for the game.
No cross-platform = no go, even for me, but Mark could sweet and(and sour 'Threads. But one at a time') that.

I would respond but I'm unable to parse this. Sorry.

As for your app's performance Warren, try throwing a delay 10 or similar(in looped threads anyway). I had to do the same.

I tried that, it was still splotchy. The thread works, is 100% smooth and it's not doing anything that will require major debugging headaches down the road. I'm good with it in this case.


AntonyWells(Posted 2005) [#21]
I would respond but I'm unable to parse this. Sorry.


A reference too far.(in fact, another one.(in fact, another one.)

I tried that, it was still splotchy.


Define splotchy? I googled it but all the results were mostly adult themed.(Not the word, the performance issues. Inconsistant share of cpu time?)


Paul "Taiphoz"(Posted 2005) [#22]
ROFL.