mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
re-enable prefetcher in miner. make prefetcher schedule async notify
This commit is contained in:
parent
42836bfe97
commit
9dc20080d5
2 changed files with 6 additions and 3 deletions
|
|
@ -245,7 +245,10 @@ func (sf *subfetcher) schedule(keys [][]byte) {
|
|||
sf.tasks = append(sf.tasks, keys...)
|
||||
sf.lock.Unlock()
|
||||
// Notify the prefetcher. The wake-chan is buffered, so this is async.
|
||||
sf.wake <- true
|
||||
select {
|
||||
case sf.wake <- true:
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
// wait waits for the subfetcher to finish it's task. It is safe to call wait multiple
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ func (env *environment) discard() {
|
|||
if env.state == nil {
|
||||
return
|
||||
}
|
||||
//env.state.StopPrefetcher()
|
||||
env.state.StopPrefetcher()
|
||||
}
|
||||
|
||||
// task contains all information for consensus engine sealing and result submitting.
|
||||
|
|
@ -711,7 +711,7 @@ func (w *worker) makeEnv(parent *types.Header, header *types.Header, coinbase co
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
//state.StartPrefetcher("miner")
|
||||
state.StartPrefetcher("miner")
|
||||
|
||||
// Note the passed coinbase may be different with header.Coinbase.
|
||||
env := &environment{
|
||||
|
|
|
|||
Loading…
Reference in a new issue