Disclaimer: no clues about what I speak about...
I do not understand what the computationally intensive logic is.
In my own words: I can imagine a very local logic that needs to run in real time, this is when e.g. many ships are involved in a dogfight and each ship's pilot AI need to decide what to do next. Add the real time sensors and the rendering, and I shiver. As this is real time, I understand it may be difficult to put it across threads, but it is also "standard" AI without very deep thinking.
Then there is the logic were the world evolve, and AI reacts to it, taking decisions and changing the world. This is not real time. Why can this not be threaded in a lower priority thread to be executed when the dogfighting is finished and the player either look at numbers on the market of a station, or look at the view while cruising or grind at an asteroid.
As I see it, this second logic contains the main world description, while the "real time module" contains a copy of the local environment only (happens infrequently, so the large data to transfer is not a problem). When landing/interacting with the rest of the universe, the background logic provides a new, updated, copy of the universe. If sometimes, when very heavy computations are required, there is a second of delay, it can be covered with nice landing graphics
So unless the problems lies already in the "dogfighting" real-time part (in which case you will have to simplify it), I do not understand where the show stopper for threading is.
Somebody cares to enlighten me?
Post
Mon Feb 06, 2017 2:49 pm
#17
Re: Monday, February 6, 2017
Thank you for keeping us (so to speak) in the loop, Josh.
This is exactly the kind of technical investigation that just plain takes time. It's not possible to guess or assume what some potential solution might do -- you have to actually build a version and go see if it works or not. And that does not happen instantaneously.
This is a tedious problem, but the space of possible technological solutions is way too big for it to be an impossible problem. Ad astra per aspera!
This is exactly the kind of technical investigation that just plain takes time. It's not possible to guess or assume what some potential solution might do -- you have to actually build a version and go see if it works or not. And that does not happen instantaneously.
This is a tedious problem, but the space of possible technological solutions is way too big for it to be an impossible problem. Ad astra per aspera!
Post
Mon Feb 06, 2017 3:34 pm
#18
Re: Monday, February 6, 2017
Obviously a quantum computer is required.
At any rate I am confident you will defeat this issue eventually. Keep attacking the problem from new angles and it is certain you will find something that is acceptable.
At any rate I am confident you will defeat this issue eventually. Keep attacking the problem from new angles and it is certain you will find something that is acceptable.
Post
Mon Feb 06, 2017 3:59 pm
#19
Re: Monday, February 6, 2017
All that sounds pretty rough, and I can't think of any other workaround besides making your own JIT compiler but I feel that would just make things even MORE complicated. Good luck!
Post
Mon Feb 06, 2017 4:23 pm
#20
Unfortunately it's no longer maintained and this repo is just holding the source of the original project, but maybe it gives you something to work from.
Alternatively you could try contacting the author directly, pretty sure this is him: http://w3.impa.br/~diego/
Good luck.
Re: Monday, February 6, 2017
Here's a github repository containing what I believe is The One True LuaThread: https://github.com/jjensen/luaplus51-al ... /luathreadJoshParnell wrote:Monday, February 6, 2017
'LuaThread' claims to be shared-memory and preemptive. Sadly it has mysteriously disappeared from the internet, and the only similarly-named impostors I can find do not implement true shared-memory/preemptive (likely because, as I found, it is not possible )
Unfortunately it's no longer maintained and this repo is just holding the source of the original project, but maybe it gives you something to work from.
Alternatively you could try contacting the author directly, pretty sure this is him: http://w3.impa.br/~diego/
Good luck.
Post
Mon Feb 06, 2017 4:35 pm
#21
It's too late for me to figure out whether that's relevant.
Re: Monday, February 6, 2017
Looking back at some of my old tests, ~7% of time was spent in MPI communication, but those were sims with tens of thousands of particles, running at about 3FPS (though they were cleverly setup so not every particle was simulated every frame)JoshParnell wrote:lots of stuff
It's too late for me to figure out whether that's relevant.
Warning: do not ask about physics unless you really want to know about physics.
The LT IRC / Alternate link || The REKT Wiki || PUDDING
The LT IRC / Alternate link || The REKT Wiki || PUDDING
Post
Mon Feb 06, 2017 7:50 pm
#22
Re: Monday, February 6, 2017
This was very interesting. If LuaJIT indeed fails to work out, do you have an idea of the next option to pursue? Or first things first?
Post
Mon Feb 06, 2017 10:28 pm
#23
Re: Monday, February 6, 2017
He got quite excited when someone mentioned Terra, so I imagine that's on the JoshList.Scytale wrote:This was very interesting. If LuaJIT indeed fails to work out, do you have an idea of the next option to pursue? Or first things first?
Post
Tue Feb 07, 2017 12:25 am
#24
Re: Monday, February 6, 2017
So what we've learned today is that performance optimization with Lua is hard and using sockets is a dark art.DWMagus wrote:Keep in mind the idea of threading on Linux before threading became 'mainstream' was to use sockets between threads. Sometimes you can even use streams. This way you're not really mixing data across the memory barrier, you're instead just writing to it like you would a file.
Not sure if this helps, but sometimes going backwards to see how things were done in the past might inspire ideas going forward.
Post
Tue Feb 07, 2017 1:44 am
#25
Re: Monday, February 6, 2017
Quoting for higher visibility.afasthorse wrote:Here's a github repository containing what I believe is The One True LuaThread: https://github.com/jjensen/luaplus51-al ... /luathreadJoshParnell wrote:Monday, February 6, 2017
'LuaThread' claims to be shared-memory and preemptive. Sadly it has mysteriously disappeared from the internet, and the only similarly-named impostors I can find do not implement true shared-memory/preemptive (likely because, as I found, it is not possible )
Unfortunately it's no longer maintained and this repo is just holding the source of the original project, but maybe it gives you something to work from.
Alternatively you could try contacting the author directly, pretty sure this is him: http://w3.impa.br/~diego/
Good luck.
Post
Tue Feb 07, 2017 2:54 am
#26
Re: Monday, February 6, 2017
seems fun, let me helpVartul wrote:Quoting for higher visibility.afasthorse wrote:Here's a github repository containing what I believe is The One True LuaThread: https://github.com/jjensen/luaplus51-al ... /luathreadJoshParnell wrote:Monday, February 6, 2017
'LuaThread' claims to be shared-memory and preemptive. Sadly it has mysteriously disappeared from the internet, and the only similarly-named impostors I can find do not implement true shared-memory/preemptive (likely because, as I found, it is not possible )
Unfortunately it's no longer maintained and this repo is just holding the source of the original project, but maybe it gives you something to work from.
Alternatively you could try contacting the author directly, pretty sure this is him: http://w3.impa.br/~diego/
Good luck.
Post
Tue Feb 07, 2017 3:03 am
#27
Re: Monday, February 6, 2017
Thanks for the update. I enjoy reading the logs, though I understand very little of what was said since I've only dabbled in programming as a hobby. And that hasn't even been recently, but reading these updates makes me want to pick it back up again.
I did get distracted by this:
Anyway, good luck to ya Josh!
I did get distracted by this:
Turns out you aren't the only one to build a Threadpool:JoshParnell wrote:Monday, February 6, 2017
...I built a threadpool ...
Anyway, good luck to ya Josh!
Post
Tue Feb 07, 2017 3:35 am
#28
Re: Monday, February 6, 2017
Might or might not be useful, but there exists and implementation for shared memory dictionaries in LUA (which seems to support LuaJIT too):
https://github.com/openresty/lua-nginx- ... shareddict
Might wanna take a look in their source and see how they did it, and expand it for tables/whatever you need to share
https://github.com/openresty/lua-nginx- ... shareddict
Might wanna take a look in their source and see how they did it, and expand it for tables/whatever you need to share
Warning: do not ask about physics unless you really want to know about physics.
The LT IRC / Alternate link || The REKT Wiki || PUDDING
The LT IRC / Alternate link || The REKT Wiki || PUDDING
Post
Tue Feb 07, 2017 10:29 am
#29
Awwww.... I want one!
Early Spring - 1055: Well, I made it to Boatmurdered, and my initial impressions can be set forth in three words: What. The. F*ck.
Re: Monday, February 6, 2017
Freezin4aReason wrote:Thanks for the update. I enjoy reading the logs, though I understand very little of what was said since I've only dabbled in programming as a hobby. And that hasn't even been recently, but reading these updates makes me want to pick it back up again.
I did get distracted by this:Turns out you aren't the only one to build a Threadpool:JoshParnell wrote:Monday, February 6, 2017
...I built a threadpool ...
Anyway, good luck to ya Josh!
Awwww.... I want one!
Early Spring - 1055: Well, I made it to Boatmurdered, and my initial impressions can be set forth in three words: What. The. F*ck.
Post
Tue Feb 07, 2017 11:36 am
#30
Re: Monday, February 6, 2017
I had a thought reading this update, so, just to add some noise...
How much fps is actually needed for debugging? I mean, how about this:
1. Write a feature-complete version in Lua or in some other scripting language.
2. Bring all them nasty bugs down at 10 fps.
3. "Translate" all the Lua stuff into good old C/C++.
4. Bing down the few remaining bugs at 30 fps.
5. Be a happy human being.
Not sure about 2. or how efficient debugging at 10 fps or even less may be. Also not sure about 3. and the "translating" stuff. But hey, I tried
How much fps is actually needed for debugging? I mean, how about this:
1. Write a feature-complete version in Lua or in some other scripting language.
2. Bring all them nasty bugs down at 10 fps.
3. "Translate" all the Lua stuff into good old C/C++.
4. Bing down the few remaining bugs at 30 fps.
5. Be a happy human being.
Not sure about 2. or how efficient debugging at 10 fps or even less may be. Also not sure about 3. and the "translating" stuff. But hey, I tried