Proof of Work refactoring and multi-core support. #176

Closed
Arceliar wants to merge 0 commits from master into master
Arceliar commented 2013-05-29 22:21:57 +02:00 (Migrated from github.com)

I moved the basic proof of work loop into it's own file, where I could mess with it easier (instead of having the same code appear a half dozen times in bitmessagemain.py).

I then modified it to attempt to detect your # of cores and launch one child process per core. It checks once per second to see if a solution has been found, and kills any remaining child processes once this has happened. I have no idea how to properly do multiprocessing in python, but this does seem to work.

Aside from faster hashing, the UI seems to be more responsive when PoW isn't in the same process.

Only tested on (X)ubuntu 12.04, YMMV.

I moved the basic proof of work loop into it's own file, where I could mess with it easier (instead of having the same code appear a half dozen times in bitmessagemain.py). I then modified it to attempt to detect your # of cores and launch one child process per core. It checks once per second to see if a solution has been found, and kills any remaining child processes once this has happened. I have no idea how to properly do multiprocessing in python, but this does seem to work. Aside from faster hashing, the UI seems to be more responsive when PoW isn't in the same process. Only tested on (X)ubuntu 12.04, YMMV.
Arceliar commented 2013-05-30 20:11:12 +02:00 (Migrated from github.com)

This now seems to be in a hackish but functional state on linux.

It could use some testing on windows, if anyone's interested. In particular, try to shut down bitmessage while proof of work is running. See if it hangs until the children exit naturally, or anything like that.

This now seems to be in a hackish but functional state on linux. It could use some testing on windows, if anyone's interested. In particular, try to shut down bitmessage while proof of work is running. See if it hangs until the children exit naturally, or anything like that.
Atheros1 commented 2013-06-03 06:29:18 +02:00 (Migrated from github.com)

Hi Arceliar,
On Friday I started working on testing and merging this. At the time, the "Consistent use of i as an iterator" commit was the latest one so I worked on a method of killing child processes on exit, and testing on various operating systems. I merged the changes into the master branch just a little while ago. I only saw the rest of your commits just now so I'm sorry they didn't get included. I will manually add the "Workers get idle priority" code and merge that into master.

Atheros

Hi Arceliar, On Friday I started working on testing and merging this. At the time, the "Consistent use of i as an iterator" commit was the latest one so I worked on a method of killing child processes on exit, and testing on various operating systems. I merged the changes into the master branch just a little while ago. I only saw the rest of your commits just now so I'm sorry they didn't get included. I will manually add the "Workers get idle priority" code and merge that into master. Atheros
This repo is archived. You cannot comment on pull requests.
No description provided.