Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Synchronisation of `wait()` and `kill()`

Đang mở
#792 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
22/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Sôi nổi
Công nghệ
cpp
Lĩnh vực
operating-systems

Hướng nghiên cứu

The issue names no files, tests or entry points, so first find where the worker threads call kill() and where the OS handler calls wait(). The open question is the synchronization design: the issue asks that the two never run at the same time for the same process identifier, and that a worker which loses the race backs out. Done means the design is agreed, the race is covered by a test, and a worker that loses the race leaves no stray kill().

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug
What

My understanding of POSIX is as follows:

When a process has terminated, it stays in the kernel's table as a zombie process until the parent has read its exit status using wait(). As soon as wait() returns, the kernel is free to delete the process and reuse its identifier.

Therefore, if we attempt to call kill() after wait(), there is a chance that we kill some completely unrelated process.

Although process identifiers are usually sequential, making this very unlikely, there is nothing which says they must be allocated that way. And even if they are, the point where the number wraps around can be arbitrarily low.

Acceptance Criteria (DoD)
  • Use of invalid process identifiers is prevented
How

If my understanding is correct, then we must guarantee that these do not happen simultanously:

  • Worker threads calling kill()
  • The OS handler calling wait()

If kill() goes first, it will find the zombie process and return ESRCH. We already handle this case properly.

If wait() goes first, and a worker thread is waiting to kill() the same identifier, the worker thread must back out without doing anything.

Ngôn ngữ chính
C++
Star
6
Fork
35
Merge trung bình
2 ngày 9 giờ
Pull request đã merge (30 ngày)
93

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của eclipse-score/lifecycle

Tất cả issue của eclipse-score/lifecycle

Issue tương tự

Thêm issue về C++

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.