LOADING: An error occurred. Update Chrome, try Firefox, or visit this post for more details.

⚠️Reddit changed how removals work, which breaks Reveddit's website. Install the extension to track removed content:Add to chromeAdd to firefoxWhat changed?
✖︎
about reveddit
⚙F.A.Q.add-ons
r/
status
copy sharelink
[+] show filters
14.3k
Thumbnail
MememojangDiscoversMultithreading(i.redd.it)
submitted 2 months ago by Rajayonin:py::cp: to /r/ProgrammerHumor (4.7m)
718 commentsredditother-discussions (2+)subreddit-indexmessage modsop-focus domain-index
since 2 months ago
13 of 13

Tip Reveddit Real-Time can notify you when your content is removed.

your account history
(check your username's removed content. why?)
Tip Check if your account has any removed comments.
view my removed comments
you are viewing a single comment's thread.
view all comments
[–][deleted]48 points2 months ago
[deleted] by user
(check your username's removed content. why?)
parenthide replies (2)as-of
[–]helicophell:py::cp::cs::c:11 points2 months ago

Oh yeah, for sure. From my own rudimentary understanding of Cosmoteer's multithreading, there's a main thread for physics entities, and every ship gets a thread assigned to it that handles all the crew pathfinding

To get such a system to be deterministic though, means you gotta have actions sync between completely separate threads that aren't even interacting with each other. No thread is allowed to run faster than the slowest thread - this is the performance cost

permalinkparentcontexthide replies (3)author-focusas-ofpreserve
[–]Colin-McMillen18 points2 months ago

Threads parallelize computations, so syncing actions is threads waiting on multiple threads to finish their jobs. This is still faster than one single thread doing everything in sequence, even if there's waiting involved.

permalinkparentcontexthide replies (1)author-focusas-ofpreserve
[–]helicophell:py::cp::cs::c:12 points2 months ago

Yes, deterministic multithreading is still faster than singlethreading, but it is still slower than not caring about determinism with multithreading

permalinkparentcontexthide replies (1)author-focusas-ofpreserve
[–]Colin-McMillen3 points2 months ago

Yep :)

permalinkparentcontexthide replies (1)author-focusas-ofpreserve
[–]Mikoai3 points2 months ago

But then when it comes to actually coding it, I feel like going multithreaded and doing it right would be such a hard task, especially for a team of devs on a large scale project (like Minecraft) that the time needed for it would make the business side reject it at every occasion. Also the boilerplate code that would be necessary to achieve this…

But then I’m jr dev so please correct me if I’m taking out of my ass since it’s not even my side of things

permalinkparentcontexthide replies (1)author-focusas-ofpreserve
[–]Baridian:ru::g::c::clj::lsp:2 points2 months ago

Writing multithreaded code is relatively easy if you write pure functional code. Since FP never updates any values ever, and race conditions always involve writing (write/write or read/write), all those problems are avoided. Since lambda calculus is Turing complete, you can write any program using a purely functional paradigm.

permalinkparentcontexthide replies (1)author-focusas-ofpreserve
[–]Mikoai2 points2 months ago

Well yeah I guess if you do purely FP maybe, but then they use Java and not say Haskell.

And I’m not saying that you cannot do FP in Java, but then it’s not what Java was made for, and for some reason they rewrote it in C# (I believe other than that it’s just their creation).

permalinkparentcontexthide replies (1)author-focusas-ofpreserve
[–]Baridian:ru::g::c::clj::lsp:2 points2 months ago

Isn’t bedrock c++? I think a big reason for the rewrite was better performance.

And yeah Java isn’t the best language for FP. But you can definitely write stuff with lees or no mutation if you know you’re going to have to deal with multithreading.

permalinkparentcontexthide replies (1)author-focusas-ofpreserve
continue this thread⟶
[–]Techhead78902 points2 months ago

So waterfall but for processor time instead of developer/coder time xD

By the way, not to dogpile on the "I could go do it better with my implementation!!" crowd but my favorite devblog about multithread recently is from Dyson sphere program: https://store.steampowered.com/news/app/1366540/view/534362428708750267

permalinkparentcontextauthor-focusas-ofpreserve
[–]BlackSwanTranarchy1 point2 months ago

I have no idea if you're right but if so that's a terrible model for multithreading, you want to start with a thread pool that maps directly to the hardware and then manage work distribution on top of that via continuation functions

permalinkparentcontextauthor-focusas-ofpreserve
[–]kaas_is_leven1 point2 months ago

Immediate mode rendering is also deferred. All rendering is deferred. Immediate mode rendering just means you don't retain UI state but instead build the entire view hierarchy from scratch every frame. So essentially instead of caching a bunch of View objects and syncing their properties with your state and vice versa, you have a script to render the whole UI based off current state as is.

permalinkparentcontextauthor-focusas-ofpreserve
r/revedditremoved.substack.com
🚨 NEWS 🚨
✖︎

Important: Reddit Changed How Removals Work

A recent Reddit update makes mod-removed content disappear from profile pages, which breaks Reveddit's website.

Install the browser extension to receive removal alerts.

Add to chromeAdd to firefox

What changed?

r/revedditremoved.substack.com