If us running in same thread, then drawing may slows updating and reversal.
Love2d have threads, but is isolated threads, no shared environment, with exchanging by messages. Is possible separate loops to updating and drawing same objects from different threads, to optimal execution on multi-core systems?
Separation of draw-loop and update-loop threads. Possible?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
-
- Prole
- Posts: 21
- Joined: Thu Mar 06, 2014 3:00 pm
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Separation of draw-loop and update-loop threads. Possibl
Maybe? I think it'll be a lot of work for a small pay-off (if it even has a pay-off), though.
Help us help you: attach a .love.
- DaedalusYoung
- Party member
- Posts: 407
- Joined: Sun Jul 14, 2013 8:04 pm
Re: Separation of draw-loop and update-loop threads. Possibl
I haven't got a lot of knowledge about this, but I'm thinking it wouldn't work, because love.update needs to be finished before love.draw anyway. You don't want to draw anything before its location is updated, if both functions run virtually at the same time.
Re: Separation of draw-loop and update-loop threads. Possibl
This sounds to me like it's in the category of "If you have to ask, you don't understand well enough to make it work".
It's going to be a huge undertaking for probably no gain and loads of really weird bugs.
It's going to be a huge undertaking for probably no gain and loads of really weird bugs.
Re: Separation of draw-loop and update-loop threads. Possibl
Isn't it much easier to just use a fairly minimal love.update-function and put all the heavy lifting of update logic in a different thread? That way you don't have to change everything so much yet you get basically the same result.
My game called Hat Cat and the Obvious Crimes Against the Fundamental Laws of Physics is out now!
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Separation of draw-loop and update-loop threads. Possibl
The difficulty with that is that you're going to have a lot of traffic between threads to facilitate that, because both the drawing thread and the updating thread need to access a lot of the same data. For a simple game it's no problem, but it just doesn't scale.
Help us help you: attach a .love.
- Jasoco
- Inner party member
- Posts: 3725
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: Separation of draw-loop and update-loop threads. Possibl
Would "diminishing returns" be an appropriate name for it? Too much work for such little benefit if any at all.
Who is online
Users browsing this forum: No registered users and 61 guests