Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hw5 #41

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

hw5 #41

wants to merge 1 commit into from

Conversation

knowledgaction
Copy link

就是利用小彭老师上课讲到的知识点,完成的这次作业。

  • 多线程安全,就是使用2个互斥锁;
  • 使用chrono里的时间戳、类型转换等相关函数;
  • 写操作,使用unique_lock;读操作,使用shared_lock;
  • 使用move()函数,移交线程控制权给ThreadPool,延长线程的生命周期。
  • 退出前,调用ThreadPool的析构函数,将所有线程都join(),才能退出。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant