2018-07-03 05:10:27
service SharedMiningService {
rpc GetWords ( GetWordsRequest ) returns ( GetWordsResponce ) {}
}
message GetWordsRequest {
repeated int64 word_indexes = 1;
}
message GetWordsResponce {
repeated bytes words = 1;
}
Fireduck
2018-07-03 20:05:38
ok, I need a super fast sorting queue
Fireduck
2018-07-03 20:07:22
basically, need to shard my queue so that it isn't blocking all the threads all the time
Fireduck
2018-07-03 20:09:02
"LayerWorkThread(snowblossom.miner.FieldSourceRemote@1622f1b)" #840 daemon prio=5 os_prio=0 tid=0x00007f03a0c24000 nid=0x9ca waiting for monitor entry [0x00007ef55c809000]
java.lang.Thread.State: BLOCKED (on object monitor)
at snowblossom.miner.Arktika.enqueue(Arktika.java:541)
- waiting to lock <0x00007ef6e0195aa0> (a com.google.common.collect.MinMaxPriorityQueue)
at snowblossom.miner.BatchLayerWorkThread.processPw(BatchLayerWorkThread.java:122)
at snowblossom.miner.BatchLayerWorkThread.runPass(BatchLayerWorkThread.java:96)
at snowblossom.miner.LayerWorkThread.run(LayerWorkThread.java:190)
Fireduck
2018-07-03 20:10:01
why do you care if it's sorted?
Tyler Boone
2018-07-03 20:10:35
guess I could go look at the code...
Tyler Boone
2018-07-03 20:12:01
it is good to be sorted a little
Fireduck
2018-07-03 20:12:09
so we can do the the work that is closer to done first
Fireduck
2018-07-03 20:12:23
and if the queue gets full, discard the ones that are less done
Fireduck
2018-07-03 20:12:34
but it doesn't need to be sorted so much as bucketed
Fireduck
2018-07-03 20:12:47
since there are only 6 states
Fireduck
2018-07-03 20:14:20
a batch load of items that are all one pass level would be good too
Fireduck
2018-07-03 20:14:25
that happens a lot
Fireduck
2018-07-03 20:51:56
yeah, I would use 6 distinct queues
Tyler Boone
2018-07-03 20:52:11
or stacks
Tyler Boone
2018-07-03 20:52:41
I would use stacks
Tyler Boone
2018-07-03 20:55:34
Sure. Also need to shard further. The problem is a bunch of threads dumping a bunch of entries
Fireduck
2018-07-03 21:00:31
adding an item to a stack is ridiculously fast. I doubt there will be contention issues.
Tyler Boone
2018-07-03 21:01:43
I think you underestimate my stupidity
Fireduck
2018-07-03 21:02:37
https://dzone.com/articles/a-specialized-high-performance-concurrent-queue This look at Java performance proposes an alternative to java.util.concurrent.BlockingQueue for multiple writing threads and a single reading thread in a queue.
Tyler Boone
2018-07-03 21:02:47
there you go
Tyler Boone
2018-07-03 21:03:43
ConcurrentLinkedQueue<E>
Fireduck
2018-07-03 22:21:54
On of those for each bucket should get it done
Fireduck