Pseudo Multi-threading?

BlitzMax Forums/BlitzMax Programming/Pseudo Multi-threading?

SculptureOfSoul(Posted 2006) [#1]
Is this possible with Bmax?

What I'd like to do is to create a seperate process for my server that simply handles login duties. Instead of constantly polling my non-blocking listening socket to see if someone is trying to connect, I'd prefer to set it up as a blocking call in it's own process. Then, when someone connects to the server, the Accept() call will return and this login process would pass the information about the socket to the master server process.

So basically, one program sits idle 99% of the time and then notifies the other program and sends it some info that other 1% of the time (when someone connects.)

Is something like this possible? How would I go about passing the data between the two different programs without doing something like writing it to disk first?


tonyg(Posted 2006) [#2]
This might help.


Damien Sturdy(Posted 2006) [#3]

This might help.



Got out the wrong side of bed this morning? :P Haha :)


SculptureOfSoul(Posted 2006) [#4]
Well, thanks to all your help (and the ahem, wonderful documentation) I've got it sort of working. ;)

I've got the process created and running, and I can intercept info that is sent to that process, but I haven't yet figured out how to have the opened process specifically send data (or better yet, a windows event) to the 'parent' process.

Will have to take a look at it later.


FlameDuck(Posted 2006) [#5]
I haven't yet figured out how to have the opened process specifically send data (or better yet, a windows event) to the 'parent' process.
THere is a pipe in the TProcess class that will allow you to read stdio.

Ideally ofcourse, for any networked type program that requires multiple instances but does not need to share data, inetd is your friend. If you use Windows, tough luck.


tonyg(Posted 2006) [#6]
Got out the wrong side of bed this morning? :P Haha :)


Ooops. Original post had several links to MultiThread topics. Thought it'd be really clever to simply link to the results implying 'search' could be used but must have ppasted an empty search page.
Simple rule... never try to be clever when you can still taste toothpaste.