Documentation ¶
Index ¶
Constants ¶
View Source
const ( DEBUG = false INFO = true )
View Source
const (
WORKSIZE = 10
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Base ¶
type Base struct { Work chan PrimeCalc Done chan PrimeCalc Primes []*big.Int PIndex uint64 NWorkers uint32 LowestKey *big.Int KeyMutex *sync.Mutex PrevEnd *big.Int PrevEndMutex *sync.Mutex Factory *utils.RedisConf }
func (*Base) CalculatePrime ¶
func (b *Base) CalculatePrime()
func (*Base) SpawnWorkers ¶
func (b *Base) SpawnWorkers()
type PriorityQueue ¶
type PriorityQueue []*QueueItem
A PriorityQueue implements heap.Interface and holds QueueItems.
func (PriorityQueue) Len ¶
func (pq PriorityQueue) Len() int
func (PriorityQueue) Less ¶
func (pq PriorityQueue) Less(i, j int) bool
func (*PriorityQueue) Pop ¶
func (pq *PriorityQueue) Pop() interface{}
func (*PriorityQueue) Push ¶
func (pq *PriorityQueue) Push(x interface{})
func (PriorityQueue) Swap ¶
func (pq PriorityQueue) Swap(i, j int)
type QueueItem ¶
type QueueItem struct {
// contains filtered or unexported fields
}
An QueueItem is something we manage in a priority queue.
type Scheduler ¶
func (*Scheduler) CreateWork ¶
Click to show internal directories.
Click to hide internal directories.