Disable signal handling and use many curl handles instead, thus making work more asynchronous.
Theoretically a curl can wait forever on a dns lookup with this but it's extremely unlikely.
Load the first queued extra work in the main function to avoid having a once-off variable in get_work().
Load an extra set of work for each function in advance once a longpoll is detected since every thread will need to get new work.
Discard requests with a separate function to ensure the right number is always queued.
Make it possible to use the thread id for getting work again.
Flag the getwork() function when we have a new block to explicitly discard any cached work when a new block is detected.
Store the header of each new work and compare it to blocks we're about to submit to decide if they're stale due to a new block and don't try to submit them.
This should significantly decrease the number of rejected blocks.
Add two new configure flags, --with-opencl-libdir and --with-opencl-inc
to specify where OpenCL headers and libraries exist. This now adds
a test for the OpenCL header file and makes not finding the library
or headers a fatal error.
Signed-off-by: Tom Rini <trini@kernel.crashing.org>
Build binaries with unique filenames from the kernel generated and save them.
Try to load this cached binary if it matches on next kernel instantiation.
This speeds up start-up dramatically, and has a unique kernel binary for different kernel configurations.
Try to load this cached binary if it matches on next kernel instantiation.
This speeds up start-up dramatically, and has a unique kernel binary for different kernel configurations.
This allows each local thread id to have one slot to put any positive results into, thus making overlapping results far less likely.
Thus races will be much rarer, allowing more threads.
It should also pick up blocks close to each other more reliably and hopefully decrease the number of rejects and opencl errors.
Do the search over the buffer entirely in a separate thread to allow the GPU to stay as busy as possible.
Detach threads from themselves to prevent unlucky even where dereferencing occurs by freeing the data that stores the thread info.