Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 10189 10190 [10191] 10192 10193 ... 11061

Author Topic: Things that made you go "WTF?" today o_O  (Read 14888367 times)

Reelya

  • Bay Watcher
    • View Profile
Re: Things that made you go "WTF?" today o_O
« Reply #152850 on: August 11, 2020, 08:17:00 pm »

multithreading is exactly as hard as everyone, including me, has always said it was. this is hell

Can you elaborate

I am curious

He means writing a computer program that uses multiple cores at the same time. synchronizing them is a nightmare. It's like herding cats, except they're 11-dimensional cats and you only exist in 3-dimensions.

The real trick to doing multithreading right is to realize you're doing it wrong before you start then design a system that doesn't need to be synchronized in the first place. If you're doing locks and mutexes and shit everywhere, then you already did it wrong. The right way is that any thread can do read-only on data it needs, but they've each got a separate data area they write to. Like, if you want to split up the game to update physics for a lot of objects, make each thread responsible for X amount of objects. they can read the data for other objects for collisions etc, but they can only write the data for their allocated objects (and make sure these are packed into actually separate memory blocks for the best effect). If you have a thing where two threads can/will both update the same object, so they have to uses locks and waiting to make sure nothing fucks up, you didn't think it through enough. "I'll need a lock/mutex here" is the first thing they teach you about multi-threading, but it should be the absolute last resort in your actual design.

One of the big stumbling blocks is in fact what's considered good design in the first place: object oriented design. What's a perfectly good and clean design for a single-threaded app turns into a quagmire when you have multiple threads of control running at once.
« Last Edit: August 11, 2020, 08:59:46 pm by Reelya »
Logged

Iduno

  • Bay Watcher
    • View Profile
Re: Things that made you go "WTF?" today o_O
« Reply #152851 on: August 11, 2020, 09:38:17 pm »

This is one strange thunderstorm.  Thunder has been continuously rolling for the past 20 minutes. Sometimes it spikes after a flash but it never completely dies down.
It's like there's some layers of air up above trapping the sound waves in a continuous echo.
It's also still bloody hot, we've been having a heatwave over here in the Netherlands for about a week now.

Yeah, heat lightning works different to other lightning. It's interesting, though.
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Things that made you go "WTF?" today o_O
« Reply #152852 on: August 11, 2020, 10:04:59 pm »

multithreading is exactly as hard as everyone, including me, has always said it was. this is hell

Can you elaborate

I am curious

He means writing a computer program that uses multiple cores at the same time. synchronizing them is a nightmare. It's like herding cats, except they're 11-dimensional cats and you only exist in 3-dimensions.

The real trick to doing multithreading right is to realize you're doing it wrong before you start then design a system that doesn't need to be synchronized in the first place. If you're doing locks and mutexes and shit everywhere, then you already did it wrong. The right way is that any thread can do read-only on data it needs, but they've each got a separate data area they write to. Like, if you want to split up the game to update physics for a lot of objects, make each thread responsible for X amount of objects. they can read the data for other objects for collisions etc, but they can only write the data for their allocated objects (and make sure these are packed into actually separate memory blocks for the best effect). If you have a thing where two threads can/will both update the same object, so they have to uses locks and waiting to make sure nothing fucks up, you didn't think it through enough. "I'll need a lock/mutex here" is the first thing they teach you about multi-threading, but it should be the absolute last resort in your actual design.

One of the big stumbling blocks is in fact what's considered good design in the first place: object oriented design. What's a perfectly good and clean design for a single-threaded app turns into a quagmire when you have multiple threads of control running at once.

not he, also,

I'm doing this for Space Station 13, you see. I'm using extools, a rather recent invention, basically DFHack for Byond. Here's the crux of the issue: I cannot run any byond functions in another thread, and at least some data must be available to the main thread.

The main way I've solved this is by, indeed, minimizing shared state as much as possible. Shared state is the enemy, yeah, and I do try to go with the single-writer-many-reader paradigm here, which is the usual trick for things.

Anyway, it works. I've taken the bogeyman, the cause of so much stress over the years, the laggy-ass monster that the game is built on, and took it from something that takes 0.35 seconds under load to something that takes 0.02 seconds under load, even though it actually does over 5x as much actual processing.

But that's a stretch of "works". It crashes. I don't know when, nor why. But it sure does. It could be a segmentation fault; it could be an out of memory error; I don't know, because it takes a goddamn hour. This is horrible.

And yeah, I've gone from "one mutex per gas mixture" to "one mutex per queue" to "one mutex, period". I straight-up can't improve on that, though; I have no choice but to have shared state. Both the main thread and the atmos thread have to write to the same data, sometimes, and the atmos thread simply cannot do certain things with the data given to it.

hector13

  • Bay Watcher
  • It’s shite being Scottish
    • View Profile
Re: Things that made you go "WTF?" today o_O
« Reply #152853 on: August 11, 2020, 10:18:27 pm »

Despite having great distaste for the franchise, I decided to watch Terminator 3.

It’s subtitle should have been Fan Service Boogaloo rather than Rise of the Machines, and it did the same thing for the previous 2 movies as 2 did for 1 in my opinion, and made it completely irrelevant, and effectively retconned them.

There were also a number of internal inconsistencies that pained me, but whatever.

I’ll probably watch the fourth one tomorrow to extend my torture for some reason.
Logged
Look, we need to raise a psychopath who will murder God, we have no time to be spending on cooking.

the way your fingertips plant meaningless soliloquies makes me think you are the true evil among us.

Enemy post

  • Bay Watcher
  • Modder/GM
    • View Profile
Re: Things that made you go "WTF?" today o_O
« Reply #152854 on: August 11, 2020, 10:59:27 pm »

Despite having great distaste for the franchise, I decided to watch Terminator 3.

It’s subtitle should have been Fan Service Boogaloo rather than Rise of the Machines, and it did the same thing for the previous 2 movies as 2 did for 1 in my opinion, and made it completely irrelevant, and effectively retconned them.

There were also a number of internal inconsistencies that pained me, but whatever.

I’ll probably watch the fourth one tomorrow to extend my torture for some reason.

Spoiler: Terminator spoilers (click to show/hide)
Logged
My mods and forum games.
Enemy post has claimed the title of Dragonsong the Harmonic of Melodious Exaltion!

hector13

  • Bay Watcher
  • It’s shite being Scottish
    • View Profile
Re: Things that made you go "WTF?" today o_O
« Reply #152855 on: August 11, 2020, 11:00:17 pm »

Ah Christ I thought there was only 5 with the new one.

I don’t think that was very spoilery, ‘cause I haven’t seen 4, 5, or 6
Logged
Look, we need to raise a psychopath who will murder God, we have no time to be spending on cooking.

the way your fingertips plant meaningless soliloquies makes me think you are the true evil among us.

Reelya

  • Bay Watcher
    • View Profile
Re: Things that made you go "WTF?" today o_O
« Reply #152856 on: August 11, 2020, 11:24:31 pm »

Despite having great distaste for the franchise, I decided to watch Terminator 3.

It’s subtitle should have been Fan Service Boogaloo rather than Rise of the Machines, and it did the same thing for the previous 2 movies as 2 did for 1 in my opinion, and made it completely irrelevant, and effectively retconned them.

There were also a number of internal inconsistencies that pained me, but whatever.

I’ll probably watch the fourth one tomorrow to extend my torture for some reason.

Save this post then cut and paste each new movie in as you go.

He

not he,


Yeah, sorry about that, I kind of assumed from the username.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Things that made you go "WTF?" today o_O
« Reply #152857 on: August 11, 2020, 11:36:04 pm »

it's a surname,

scriver

  • Bay Watcher
  • City streets ain't got much pity
    • View Profile
Re: Things that made you go "WTF?" today o_O
« Reply #152858 on: August 12, 2020, 04:14:10 am »

I thought your name was Putnam Ehere?
Logged
Love, scriver~

ChairmanPoo

  • Bay Watcher
  • Send in the clowns
    • View Profile
Re: Things that made you go "WTF?" today o_O
« Reply #152859 on: August 12, 2020, 05:10:15 am »

My name is Et Al
Logged
Everyone sucks at everything. Until they don't. Not sucking is a product of time invested.

Frumple

  • Bay Watcher
  • The Prettiest Kyuuki
    • View Profile
Re: Things that made you go "WTF?" today o_O
« Reply #152860 on: August 12, 2020, 07:47:03 am »

"We destroyed the bridge to our closest ally to stop the flying lizards from getting here!"

wait what

7th dragon no, you were doing okay up until you decided to burn bridges to "slow down" an army of flight capable monsters

why
Logged
Ask not!
What your country can hump for you.
Ask!
What you can hump for your country.

hector13

  • Bay Watcher
  • It’s shite being Scottish
    • View Profile
Re: Things that made you go "WTF?" today o_O
« Reply #152861 on: August 12, 2020, 08:47:42 pm »

Terminator Salvation wasn’t too bad, but I guess coming off 3, that’s not saying too much.

The references to the previous films were much more organic, and it took itself and the source material seriously enough. Kept you guessing too.

I wasn’t pay too much attention though. Maybe that’s the secret.
Logged
Look, we need to raise a psychopath who will murder God, we have no time to be spending on cooking.

the way your fingertips plant meaningless soliloquies makes me think you are the true evil among us.

dragdeler

  • Bay Watcher
    • View Profile
Re: Things that made you go "WTF?" today o_O
« Reply #152862 on: August 13, 2020, 02:41:44 am »

-
« Last Edit: November 21, 2020, 10:42:43 am by dragdeler »
Logged
let

wierd

  • Bay Watcher
  • I like to eat small children.
    • View Profile
Re: Things that made you go "WTF?" today o_O
« Reply #152863 on: August 13, 2020, 02:45:25 am »

I feel for you drags.

I have a broken off filling that happened *JUST* as corona was taking off, and have been in the "Nope, cant see dentist" hell ever since.

I am probably gonna get a goddamn abscess by the time they (government in my area) figures out that "Ignore!!" is not a valid solution to this problem, and it becomes safe to visit the dentist to have it fixed.
Logged

dragdeler

  • Bay Watcher
    • View Profile
Re: Things that made you go "WTF?" today o_O
« Reply #152864 on: August 13, 2020, 02:52:31 am »

-
« Last Edit: November 21, 2020, 10:42:48 am by dragdeler »
Logged
let
Pages: 1 ... 10189 10190 [10191] 10192 10193 ... 11061