jackfrued / jackfrued/Python-100-Days
为什么第13天进程与线程,最后那个从1加到1亿的例子不用给“临界资源”加锁?
Open
Nobody has claimed this yet.
- Dominant language
- Jupyter Notebook
- Stars
- 187k
- Forks
- 55.8k
- PR merge metrics
- No merged PRs in 30d
Description
你好,我在学习进程与线程时发现,前面的例子100个人转账1元到同一个账户中,不加锁会返回错误。那后面这个多进程的例子不用,是因为queue模块会帮这些共用变量加锁吗?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Day 13 process-and-thread examples mentioned in the issue, especially the 100-person transfer case and the example that increments a value from 1 to 100 million. Read the queue module usage and compare how shared state is handled; done means documenting whether queue provides the relevant locking and why the two examples differ.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100