Jump to content

L B

Members
  • Posts

    967
  • Joined

  • Last visited

Posts posted by L B

  1. It's amusing that both you and Metatron are attempting this simultaneously.

     

    He's shown proof of concept, which means that it's possible for other languages (C#) to do it!

    The modification(s) to be done is(/are) in the engine DLL, hence why Metatron has to do it. And then, from that point, any language could use it.

  2. The main problem seems to be that the other threads don't have an active OpenGL canvas or driver, so for example LoadTexture fails because the maximum texture size is 0 (instead of 8192 like on the main thread).

     

    However, when I preload and free the models in the main thread first, then it works also on the other threads:

    FreeEntity(LoadMesh("oildrum.gmf"));
    FreeEntity(LoadMesh("mushroom.gmf"));

    How did changing the memory structure as we discussed the other day work out?

  3. Mm. Josh never said anything about it though. His answer seems to be that we always have to call Leadwerks methods on the main thread - which is false, with proper synchronization, only LoadModel seems to be failing right now.

     

    Maybe Mika could help us figure a workaround with the source?

  4. Strange, your approach with locking should work just fine... You could also use a concurrent_queue and load everything from your main thread. Just push_back everywhere you need it, and try_pop on the main thread.

    You're suggesting C/++ methods to the wrong guy. :)

     

    Besides, I did have a queue on the main thread to work so far, but that turned out limiting after a while. So I really need to actually load the models on another thread. No fake, no almost.

  5. I have managed to enable simple multi-threading by using a lock, or mutual-exclusion (mutex) system. Basically, I lock around all Leadwerks commands, so that none of them can be called at the same time, and forcing them to execute sequentially.

     

    This works really well for all commands. Except for the ones which create an entity, be it a body, model, mesh, light, etc.I'm wondering why that occurs, but most importantly, how can I truly create an entity on another thread.

     

    I know I could invoke the entity to be created on the main thread (using a delegate that gets executed at the next loop), and this is the approach I've used so far. However, for many reasons, I would like to create entities on other threads.

     

    How can I *truly* create entities on other threads without Leadwerks crashing?

  6. I'd wait until C# is officially supported in LE3. But if really any of you need a hand with adding funcitonalities, just let me know. I might also have them already implemented in my version here.

  7. Useless comparison:

    - VS2008 has secure SCL enabled by default in release. This is a performance impact of 2X in release builds.

    - hash_map is not even standard C++. Use C++0x unordered_map instead.

    - No garbage collector in play? You should also remove the C++ allocating and deallocating time...

    - std::string is slow in VS2008, duh no move semantics. Test this in VS2010.

    - Port C# to C++ one on one? Even the other way around this is a bad practice.

     

    I use C# often, even more as C++ lately, but saying the performance impact is minimal with these kind of test is just plain wrong! Especially for games, I needed to add a lot of caching to avoid lag... I'm not even speaking about the cold and warm starts of native .NET code.

    Like others stated in the comments, this isn't a real-life example. You can love up in both languages!

    Seems like someone hasn't read anything of the "Updates to this article" part, and jumped straight to the benchmarks. Most of your complaints are addressed there. Moreover, why don't you tell the article author instead of us? We surely won't satisfy your intentions.

  8. The Werkspace community implied? you mean the very small percentage of those that use c# surely?

    No, I meant these comments.

     

    RP, feel free to host the files. If people are determined, they'll just reflector it.

×
×
  • Create New...