GameMonkey Script

GameMonkey Script Forums
It is currently Mon Nov 20, 2017 3:23 pm

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Wed Jun 09, 2010 1:53 pm 
Offline

Joined: Thu Sep 25, 2008 6:28 am
Posts: 24
I'm attempting to run two machines, each in a different thread.

During a single threaded part, I'm copying tables from one thread to another, using Set and iterating over the tables. This is causing problems in the garbage collector, (it takes a ton of RAM, and it will eventually crash when running a full GC).

Is there a way to copy all of the data from one machine to another so my scheme of running two machines will work?

Thanks.
-Shawn.


Top
 Profile  
Reply with quote  
PostPosted: Wed Jun 09, 2010 9:38 pm 
Offline

Joined: Fri Jan 14, 2005 2:28 am
Posts: 439
I strongly recommend against this, and recommend against using multiple instances of the VM.


Top
 Profile  
Reply with quote  
PostPosted: Mon Jun 14, 2010 10:24 pm 
Offline

Joined: Thu Jan 01, 2004 4:31 pm
Posts: 307
Out of interest, why are you doing this?


Top
 Profile  
Reply with quote  
PostPosted: Tue Jun 15, 2010 10:23 pm 
Offline

Joined: Fri Jan 14, 2005 2:28 am
Posts: 439
even though I disapprove, I suspect it's not safe to set any reference type(user object, string, table, function, etc) directly into the tables in the destination VM.


Top
 Profile  
Reply with quote  
PostPosted: Wed Jun 16, 2010 1:41 pm 
Offline

Joined: Thu Sep 25, 2008 6:28 am
Posts: 24
I'm already duplicating the string tables, and that's fine. I don't use user objects ever, and don't need to copy functions - just primitive data in tables.

The reason for this is I do all my geometry generation in script, and normally I use run two threads: one for game logic, one for generating an instruction list to send to the renderer. The update and render run at the same time, when they're both done all data from the update thread gets copied to the render data buffer for use on the next render thread, (the render thread is 1 frame behind). I'd like to be able to apply this to GM as well by running two machines, one in each thread, then copy relevant data.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group