ChunkWriter sync trying to improve chunk join speed
This commit is contained in:
tonikelope 2021-01-12 23:15:15 +01:00
parent 5847ff5cca
commit 1b8467c7a6
4 changed files with 51 additions and 46 deletions

View File

@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.tonikelope</groupId>
<artifactId>MegaBasterd</artifactId>
<version>7.38</version>
<version>7.39</version>
<packaging>jar</packaging>
<dependencies>
<dependency>

View File

@ -159,6 +159,8 @@ public class ChunkWriterManager implements Runnable, SecureSingleThreadNotifiabl
if (_file_size > 0) {
while (!_exit && (!_download.isStopped() || !_download.getChunkworkers().isEmpty()) && _bytes_written < _file_size) {
synchronized (ChunkWriterManager.class) {
boolean chunk_io_error;
do {
@ -216,6 +218,8 @@ public class ChunkWriterManager implements Runnable, SecureSingleThreadNotifiabl
}
} while (chunk_io_error);
}
if (!_exit && (!_download.isStopped() || !_download.getChunkworkers().isEmpty()) && _bytes_written < _file_size) {
LOG.log(Level.INFO, "{0} ChunkWriterManager waiting for chunk [{1}] {2}...", new Object[]{Thread.currentThread().getName(), _last_chunk_id_written + 1, _download.getFile_name()});
@ -223,6 +227,7 @@ public class ChunkWriterManager implements Runnable, SecureSingleThreadNotifiabl
secureWait();
}
}
if (_bytes_written == _file_size) {

View File

@ -60,7 +60,7 @@ import javax.swing.UIManager;
*/
public final class MainPanel {
public static final String VERSION = "7.38";
public static final String VERSION = "7.39";
public static final boolean FORCE_SMART_PROXY = false; //TRUE FOR DEBUGING SMART PROXY
public static final int THROTTLE_SLICE_SIZE = 16 * 1024;
public static final int DEFAULT_BYTE_BUFFER_SIZE = 16 * 1024;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 KiB

After

Width:  |  Height:  |  Size: 184 KiB