HackerTrans
TopNewTrendsCommentsPastAskShowJobs

dreamingincode

237 karmajoined 11 yıl önce

Submissions

Scaling Laws, Honestly

completeskeptic.com
3 points·by dreamingincode·6 gün önce·0 comments

Bacterial biofilms are intrinsic components of calcium-based kidney stones

pnas.org
2 points·by dreamingincode·4 ay önce·0 comments

comments

dreamingincode
·2 yıl önce·discuss
The full name "Jia Cheong Tan" doesn't sound like Mainland China. The name and actions could be intentionally misleading though.

https://news.ycombinator.com/item?id=39867737
dreamingincode
·7 yıl önce·discuss
Thank you again for all the explanations!
dreamingincode
·7 yıl önce·discuss
I see. It seems sometimes we do have to live with non-deterministic behaviors or even small errors.

I'm still unsure about the following question from your answers: > when some kind of mechanism mutates two entities in different chunks, which thread is chosen to run this mutation? And how does it mutate the state for the entity in the other chunk? My initial thought was this would require adding locking on every entity, since it might be accessed from another chunk/thread. But that's clearly not ideal. Maybe have a separate list for outside-chunk changes, and merge them with internal changes later?

And regarding having two states: How/when are you sending world state to clients? My thought was to clone the current state periodically and send it to clients (can sending takes less than one tick? I don't have an idea). Sending state to clients seems to be needed if the game needs client side predication, hence this question.
dreamingincode
·7 yıl önce·discuss
Thanks! The idea of having a list of migrating entities per chunk is good, and it avoids locking on the list of all entities in a chunk. But I still have some confusion about it:

> The server looks up the destination in the "active chunk set" I mentioned

but what if the entity teleports to an inactive chunk?

> and then uses per-chunk std::vector<>s guarded by a mutex to push "migrating" entities.

Will these migrating entities participate in later calculation within the same tick, or are they excluded? If excluded, what happens when there are two mechanisms that mutates that entity, but the first one put it into the migrating list of another chunk? If included, the thread of which chunk will continue this calculation?

And when some kind of mechanism mutates two entities in different chunks, which thread is chosen to run this mutation? And how does it mutate the state for an entity in the other chunk?

Meanwhile since you mentioned ticks, (just to be sure) are you using a barrier per tick to wait for all threads to finish the same tick? When are the migrating entities merged into the main list, and are you using another barrier for that?
dreamingincode
·7 yıl önce·discuss
Thanks for the explanation! I happened to be thinking of similar multithreading ideas (chunks and ping-ponging states) recently, but was stuck on what happens when computation happens across chunks in multiple threads. e.g. an object move across chunk border, or an object interaction affecting two objects in different chunks. Could you elavorate on your approach about these? I'm really curious