Results 1 to 5 of 5

Multitcore use via Gametype scripting - Is it possible?

  1. #1
    Member -=[F@LC0]=-'s Avatar
    Join Date
    Mar 2006
    Location
    Germany

    Multitcore use via Gametype scripting - Is it possible?

    Ok guys, I was off a while because of exams.

    While sitting at home learning stuff, I thought a bout something regarding Gamemode coding.

    I googled a bit about the ability to create simultaneous functions in Lua, so that more then one Core could be used for the script.
    I got to this point because I wanted to make Every CPU player be controlled by his own AddRule(...).

    Anyone got experience in coding mutitheaded? Or is there anyone who could tell me if this could be achived by simply implenting it in the gamemode scritp?


    I like to use it for my EVE mod to divide the needed processing power over several CPU cores.
    I know that HW2 itself has no multicore support, but who avoids us from coding our own multicore supporting functions or gamerules?

    Maybe this question it totally dump because the application itself makes it impossible, but I think it should be discussed, as I never found something like that in the Forum.


    Best Regards
    Mr.Thi

  2. #2
    Member -=[F@LC0]=-'s Avatar
    Join Date
    Mar 2006
    Location
    Germany
    Ok, searching this morning I found a few interesting things about it.

    I started at Coroutines, wich seem to be a form of pausing functions to run another under certain conditions ... not really multicore useage.

    Then I found this:
    http://lua-users.org/lists/lua-l/2011-04/msg00363.html

    It seems to be a method of creating single functions wich are run as a single threat. Wich only get input and do output back to the original code. Sounds interesting to me.


    Lua Lanes seems to be the same but with possible communication between threads.
    http://kotisivu.dnainternet.net/askok/bin/lanes/


    I hope to get time to take a deeper look at it.
    But maybe someone else likes to join this discussion.

  3. #3
    Member -=[F@LC0]=-'s Avatar
    Join Date
    Mar 2006
    Location
    Germany
    Nice, I managed to test a few things with lua lanes, it really uses all 4 cores of my i7 if I have 4 threads running. It seems to be easy to use, but I'm not sure how to include it in to Homeworld 2.

    The Problem is, that I don't know how to load the libaries (lanes.lua and lua51-lanes.dll).

    "require" does not really work, because HW2 log told me it's unkown / nil.
    do filepath is recognised, but the HW2 got stuck at lanes.gen function. (a function defined in another lua file) I tried to call it via gen(...) wich should work,... at least it's working for all other functions this way.

    I hope there is someone who can help me out here. I really think it looks promising.

  4. #4
    Member -=[F@LC0]=-'s Avatar
    Join Date
    Mar 2006
    Location
    Germany
    I think we can close this. It may be possible, but not for sure. In addition Lanes is using Lua 5 and HW2 Lua 4, so there could also be compatibility issues.
    See this as reference:
    http://complex.mastertopforum.com/mu...le-vt3362.html

    Regars
    Mr.Thi

  5. #5
    Technically Mr. Thi you just broke the "No Bumping" rules 3 times, but I forgive you because this was quite interesting. Shame it ended so badly though.
    @Relic: Buy yourselves back from THQ and make HW3 already.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •