Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Asynchronous texture, model loading
06-02-2011, 09:45 PM,
Asynchronous texture, model loading
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)?
06-02-2011, 09:49 PM,
And for threading in general. Should we use sdl_thread or pick boost::thread. Do you have any preferences?
06-06-2011, 10:35 AM,
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?
06-06-2011, 01:35 PM,
No thread pools in boost. Looks like there is an implementation on sourceforge 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.
06-06-2011, 02:39 PM,
We can use asio. Would be a candidate for the network implementation too:
06-07-2011, 10:21 AM,
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!

Forum Jump:

Users browsing this thread: 1 Guest(s)