Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Asynchronous texture, model loading
06-02-2011, 09:45 PM,
#1
Asynchronous texture, model loading
@joevenzon:
I'd like to run the track loader in a separate thread. The model and texture loaders are emitting opengl calls. This means I need a separate context for the loader next to the main drawing context. Any ideas, suggestions where to plug the implementation into(track loader, graphics)?
Reply
06-02-2011, 09:49 PM,
#2
 
And for threading in general. Should we use sdl_thread or pick boost::thread. Do you have any preferences?
Reply
06-06-2011, 10:35 AM,
#3
 
I like thread pools where you can send a self-contained task to a pool of worker threads and it automatically gets scheduled and executed. Does boost do that? I know OpenTBB does, but that's pretty heavy-weight.

I think we should strip the OpenGL calls out of the loader and just do the rest of the work (which is hopefully the heavy lifting) in the separate thread and then have the main thread do the OpenGL calls (with some kind of rate limit). Hopefully, the loader code is mostly free of side-effects once the OpenGL stuff is stripped out.

Why do you want to make the track loader run in a separate thread? I don't think it will speed up the loading, unless you run multiple loader threads and divide up the work. Is that your plan?
Reply
06-06-2011, 01:35 PM,
#4
 
No thread pools in boost. Looks like there is an implementation on sourceforge http://threadpool.sourceforge.net/. Not sure how usable it is.

Moving the OpenGL calls should work. This means GRAPHICS_INTERFACE would have AddBufferObject(...), AddTexture(..)?

I'd like to experiment with track object streaming.
Reply
06-06-2011, 02:39 PM,
#5
 
We can use asio. Would be a candidate for the network implementation too: http://think-async.com/Asio/Recipes?skin...uting_arbi
Reply
06-07-2011, 10:21 AM,
#6
 
Awesome, I like ASIO, I didn't realize it could do that.

I think the GRAPHICS_INTERFACE is the right place to put those functions.

Streaming would be really cool. We have some big tracks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)