Viewing a response to: @bruce-forks/re-steempytutorials-daily-steem-python-challenge-19-win-1-steem-20180201t054041432z
Nice work! I will send you the prize money. Question: You create a separate dict for each thread: `results.append({})` And you also lock this dict for every write: ``` lock.acquire() if operation not in self.stats: self.stats[operation] = 1 else: self.stats[operation] += 1 lock.release() ``` Is this required since the dict is still part of the results list? I do not know, so this is a genuine question. My solution is a bit different in that regard and also yields faster times, I will be submitting a tutorial soon.
author | juliank |
---|---|
permlink | re-bruce-forks-re-steempytutorials-daily-steem-python-challenge-19-win-1-steem-20180202t000838091z |
category | programming |
json_metadata | {"tags":["programming"],"app":"steemit/0.1"} |
created | 2018-02-02 00:08:39 |
last_update | 2018-02-02 00:08:39 |
depth | 2 |
children | 1 |
last_payout | 2018-02-09 00:08:39 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 598 |
author_reputation | 117,823,071,447,502 |
root_title | "Daily Steem-Python Challenge #19, Win 1 Steem!" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 34,256,737 |
net_rshares | 613,754,140 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
bruce-forks | 0 | 613,754,140 | 100% |
Yeah, I don't think that lock is necessary. I used it because I thought since they are all part of a larger array I should use it to be safe, but I think it would be just as safe without. Nice catch!
author | bruce-forks |
---|---|
permlink | re-juliank-re-bruce-forks-re-steempytutorials-daily-steem-python-challenge-19-win-1-steem-20180203t223425340z |
category | programming |
json_metadata | {"tags":["programming"],"app":"steemit/0.1"} |
created | 2018-02-03 22:34:24 |
last_update | 2018-02-03 22:34:24 |
depth | 3 |
children | 0 |
last_payout | 2018-02-10 22:34:24 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 199 |
author_reputation | 534,201,026,995 |
root_title | "Daily Steem-Python Challenge #19, Win 1 Steem!" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 34,744,984 |
net_rshares | 0 |