Running two copies of same threaded exe....

BlitzMax Forums/BlitzMax Programming/Running two copies of same threaded exe....

Regular K(Posted 2008) [#1]
So I just compiled the modules threaded, and thought to see how my game runs without multithreaded added (but compiled with threading)

I run one copy, and it works. Then if I try to run a second copy while the first is running I get:
"---------------------------
Fatal error in gc
---------------------------
Open of log file failed
---------------------------
OK
---------------------------"

and once I hit OK I get the standard windows error.


For most games this isn't a problem, but since I am making an online game it would be nice to be able to run two clients at once.


Brucey(Posted 2008) [#2]
I would guess the first thing I would do would be to disable logging.


Regular K(Posted 2008) [#3]
Logging? What logging? :o


plash(Posted 2008) [#4]
"Open of log file failed"?


Hotcakes(Posted 2008) [#5]
Obviously the GC wants to log something somewhere, Regular K, and the second instance is not able to open the file for writing while the first instance has it locked.


Regular K(Posted 2008) [#6]
Hmm, odd. I can run two copies at the same time if I don't compile with threading though.

If I make a simple program thats just 'Notify "HELLO WORLD"' it works.

I figure the error I get is some odd combination of my program and the new GC.


plash(Posted 2008) [#7]
Since when did the GC log stuff?


TomToad(Posted 2008) [#8]
The GC that is used for threaded compiles saves a log for some reason. I don't know if this is only in debug or if it will do the same for release. Compiling without threading uses the BMax own GC and there is no problems with that. There is probably a function that can be called which would turn off logging.


Regular K(Posted 2008) [#9]
Still occurs in release compile.


Dreamora(Posted 2008) [#10]
disable threading or don't run 2 instances of it.
there is no way around it

Obviously the GC wants to log something somewhere, Regular K, and the second instance is not able to open the file for writing while the first instance has it locked.

this is independent of debug mode nor not


Regular K(Posted 2008) [#11]
It works if I run one client, then rename the exe and run that renamed exe. I guess I'll have to do that.


Hotcakes(Posted 2008) [#12]
Yes, threading introduces a new GC so when threading is off you are using the old GC which does not log.

I guess the logfile it uses is based on the application filename. There must be an option somewhere in its source to turn logging off though.