atlarge-research / opencraft

Other
4 stars 2 forks source link

Concurrent chunk generation - [merged] #174

Closed jdonkervliet closed 4 years ago

jdonkervliet commented 4 years ago

In GitLab by @swabbur on Jun 6, 2020, 22:09

Merges feature/concurrent-chunk-generation -> development

Resolves issue #92.

In the current version of this branch, the chunks are being generated one after another, but via the priority executor. Allowing the main thread to continue processing messages and events, increasing the tick rate while loading many chunks.

jdonkervliet commented 4 years ago

In GitLab by @larsdetombe on Jun 8, 2020, 11:30

Commented on src/main/java/net/glowstone/chunk/ChunkManager.java line 112

Do you want to add a chunk here? Even though the original code is only meant for checking if the chunk is loaded and did not have the ability to add a chunk?

jdonkervliet commented 4 years ago

In GitLab by @larsdetombe on Jun 8, 2020, 11:33

Commented on src/main/java/net/glowstone/chunk/ChunkManager.java line 160

Can't this be caught in the upper try block, I believe it is possible to have multiple catches for one try statement. Becuase now we have a nested try-block

jdonkervliet commented 4 years ago

In GitLab by @JimVliet on Jun 8, 2020, 12:02

Commented on src/main/java/net/glowstone/chunk/ChunkManager.java line 500

This curly bracket should be on a newline.

jdonkervliet commented 4 years ago

In GitLab by @JimVliet on Jun 8, 2020, 12:05

Commented on src/main/java/net/glowstone/chunk/GlowChunk.java line 900

Perhaps we can determine the initial capacity based on the server view distance? I think that would make more sense than these seemingly random variables.

jdonkervliet commented 4 years ago

In GitLab by @swabbur on Jun 8, 2020, 20:17

Commented on src/main/java/net/glowstone/chunk/ChunkManager.java line 112

Adding a chunk here is trivial, as no loading is initiated, and would make sure that future calls made on the chunk variable always return the correct value.

jdonkervliet commented 4 years ago

In GitLab by @swabbur on Jun 8, 2020, 20:20

Commented on src/main/java/net/glowstone/chunk/GlowChunk.java line 900

As the map is initialized prior to the call to the main method, the server's view distance is not yet known. Increasing the reserved memory of the map after initializing the server seems a bit overkill, as it will most likely be resized many times during execution anyways.

jdonkervliet commented 4 years ago

In GitLab by @JimVliet on Jun 9, 2020, 24:19

Commented on src/main/java/net/glowstone/chunk/ChunkManager.java line 500

changed this line in version 2 of the diff

jdonkervliet commented 4 years ago

In GitLab by @JimVliet on Jun 9, 2020, 24:19

added 1 commit

Compare with previous version

jdonkervliet commented 4 years ago

In GitLab by @JimVliet on Jun 9, 2020, 12:35

Commented on src/main/java/net/glowstone/chunk/ChunkManager.java line 160

If we catch it at the outer try/catch block, the server will not continue generating the chunk in case of a disk I/O error.

jdonkervliet commented 4 years ago

In GitLab by @JimVliet on Jun 9, 2020, 17:59

added 1 commit

Compare with previous version

jdonkervliet commented 4 years ago

In GitLab by @JimVliet on Jun 9, 2020, 18:07

added 12 commits

Compare with previous version

jdonkervliet commented 4 years ago

In GitLab by @JimVliet on Jun 9, 2020, 18:13

resolved all threads

jdonkervliet commented 4 years ago

In GitLab by @JimVliet on Jun 9, 2020, 18:13

unmarked as a Work In Progress

jdonkervliet commented 4 years ago

In GitLab by @swabbur on Jun 9, 2020, 18:21

Commented on src/main/java/net/glowstone/chunk/ChunkManager.java line 39

Why is the ChunkManager no longer final?

jdonkervliet commented 4 years ago

In GitLab by @swabbur on Jun 9, 2020, 18:24

Commented on src/test/java/net/glowstone/executor/PriorityRunnableTest.java line 46

As this class was created twice, might it be better to simply create a separate file for it? Something like TestRunnable?

jdonkervliet commented 4 years ago

In GitLab by @JimVliet on Jun 9, 2020, 19:58

Commented on src/main/java/net/glowstone/chunk/ChunkManager.java line 39

This was needed for mocking it in the ChunkRunnableTest class.

jdonkervliet commented 4 years ago

In GitLab by @JimVliet on Jun 9, 2020, 19:59

Commented on src/test/java/net/glowstone/executor/PriorityRunnableTest.java line 46

The name of the class is the same, but the implementation is not. So they need to be separate anyway.

jdonkervliet commented 4 years ago

In GitLab by @JimVliet on Jun 9, 2020, 20:11

added 1 commit

Compare with previous version

jdonkervliet commented 4 years ago

In GitLab by @swabbur on Jun 10, 2020, 10:23

resolved all threads

jdonkervliet commented 4 years ago

In GitLab by @JimVliet on Jun 10, 2020, 10:47

Commented on src/main/java/net/glowstone/chunk/ChunkManager.java line 39

changed this line in version 6 of the diff

jdonkervliet commented 4 years ago

In GitLab by @JimVliet on Jun 10, 2020, 10:47

added 1 commit

Compare with previous version

jdonkervliet commented 4 years ago

In GitLab by @swabbur on Jun 10, 2020, 11:01

Commented on src/main/java/net/glowstone/executor/ChunkRunnable.java line 74

Missing whiteline at start of method.

jdonkervliet commented 4 years ago

In GitLab by @julian9499 on Jun 10, 2020, 11:01

Commented on src/main/java/net/glowstone/chunk/GlowChunk.java line 900

Can we make constants of these numbers? They don't mean much to me like this

jdonkervliet commented 4 years ago

In GitLab by @swabbur on Jun 10, 2020, 11:03

Commented on src/main/java/net/glowstone/executor/PriorityExecutor.java line 14

Having the generic type named identical to an explicit type might be a little confusing, is there an alternative name we could use?

jdonkervliet commented 4 years ago

In GitLab by @JimVliet on Jun 10, 2020, 11:32

Commented on src/main/java/net/glowstone/executor/PriorityExecutor.java line 14

changed this line in version 7 of the diff

jdonkervliet commented 4 years ago

In GitLab by @JimVliet on Jun 10, 2020, 11:32

added 1 commit

Compare with previous version

jdonkervliet commented 4 years ago

In GitLab by @JimVliet on Jun 10, 2020, 11:36

Commented on src/main/java/net/glowstone/chunk/GlowChunk.java line 900

changed this line in version 8 of the diff

jdonkervliet commented 4 years ago

In GitLab by @JimVliet on Jun 10, 2020, 11:36

Commented on src/main/java/net/glowstone/chunk/GlowChunk.java line 900

changed this line in version 8 of the diff

jdonkervliet commented 4 years ago

In GitLab by @JimVliet on Jun 10, 2020, 11:36

added 1 commit

Compare with previous version

jdonkervliet commented 4 years ago

In GitLab by @swabbur on Jun 10, 2020, 12:24

resolved all threads

jdonkervliet commented 4 years ago

In GitLab by @swabbur on Jun 10, 2020, 12:24

merged

jdonkervliet commented 4 years ago

In GitLab by @swabbur on Jun 10, 2020, 12:24

mentioned in commit 2601aced46ed3068d20fc722fcbc1d3eaed4496b

jdonkervliet commented 4 years ago

In GitLab by @JimVliet on Jun 10, 2020, 12:37

resolved all threads