31
DF Suggestions / Re: DF Eternal Suggestion Voting
« on: April 26, 2010, 05:32:50 am »
Don't patronise me, I can read the big, prominent rules text just fine. It doesn't say anything about bumping threads.
March 6, 2024: Dwarf Fortress 50.12 has been released.
News: February 3, 2024: The February '24 Report is up.
News: February 4, 2021: Dwarf Fortress Talk #28 has been posted.
News: November 21, 2018: A new Threetoe story has been posted.
Forum Guidelines
It's been discussed, in threads more relevant to it than this one. Go post there. Or better yet, read those posts about why it won't happen and STFU because it's not going to happen.And it will be discussed again and again and again like many other subjects as new people bring it up, and each time I'll make the same points I did last time it was discussed. Also it will happen eventually as individual cores aren't getting faster quickly enough but I agree it won't happen any time soon.
But not in this thread. That's my point.
Well, yes. I just brought it up to illustrate that multithreading stuff doesn't necessarily take ages to implement. I'm rolling my own as an exercise. Obviously if Toady's ever going to use multithreading he should use someone else's library.[edit]Oh, and it doesn't take long to write a thread management library either. Mine's taking me about a week all up.[/edit]
Alternatively, rather than reinventing the wheel you could just use something like TBB, your example in particular is well suited for it.
The fact that the game has not been built to be multithreaded means any attempt to do so would require a complete overhaul of the code, which would take a very long time
//pseudocode
for each dwarf
{
dwarf.update();
}
Say update() takes a while to run, maybe it's working out the dwarf's current activity and/or pathfinding to get there.//pseudocode
for each dwarf
{
threadManager.QueueTask(dwarf, dwarf::update);
}
wait for threads to finish
It just occurred to me how awesome an artifact toilet would be.Especially one made out of shit.