Jump to content

Threadding Out Map::Load


xtreampb
 Share

Recommended Posts

Loading my simple, small map takes a good bit of time. Is it possible to make my Map::Load(std::String) multi-threaded? I would like to load each entity using a separate thread from a pool of threads. So something like:

Map::Load(std::String PathToMap, int numThreads);

 

it would create numThreads +1. spool one thread to manager the other threads and will receive the result (returning entity) from each thread. If there are other entities to load, will then begin loading another entity with the recently returned thread. once all entites are loaded, the map object is then sent to back to the main thread. This would allow me to create like a loading screen that isn't stalled.

 

I suppose i could do this myself, i would just need to know how the map::load function finds it entities (gets it's list and path)

bool Life()
{
 while(death=false)
 {
   if(death==true)
   return death;
 }
}

 

I have found the secret to infinite life

 

Did I help you out? Like my post!

Link to comment
Share on other sites

I would not attempt this. Map entities are intermixed in all sorts of different ways, and the OpenGL calls are all over the place too. It's just not a problem that can be easily parallelized.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...