named_condition_any does not appear to notify
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- cpp
- Lĩnh vực
- operating-systems
Hướng nghiên cứu
Bắt đầu với reproducer và biên dịch nó trên Linux bằng Boost 1.68.0. So sánh hành vi và các đường dẫn triển khai của boost/interprocess/sync/named_condition_any.hpp và named_condition.hpp, sau đó xác minh rằng tiến trình con nhận được thông báo khi sử dụng named_condition_any, bao gồm cả các lần chờ có thời hạn.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I haven't been able to get named_condition_any objects to work on Linux with Boost 1.68.0. Below is code to replicate. When using a named_condition_any the child process will never receive the notification, when using just a named_condition the child process receives the notifications.
#include <boost/interprocess/sync/named_condition_any.hpp>
#include <boost/interprocess/sync/named_condition.hpp>
#include <boost/interprocess/sync/named_mutex.hpp>
#include <boost/thread/thread_time.hpp>
#include <unistd.h>
#include <chrono>
#include <thread>
#include <iostream>
namespace ip = boost::interprocess;
int main()
{
typedef ip::named_mutex mutex_type;
//typedef ip::named_condition condition_type;
typedef ip::named_condition_any condition_type;
mutex_type::remove("test_mutex");
condition_type::remove("test_condition");
pid_t pid = fork();
if(pid == 0)
{ // parent process
mutex_type mutex(ip::open_or_create, "test_mutex");
condition_type condition(ip::open_or_create, "test_condition");
while(true)
{
std::this_thread::sleep_for(std::chrono::seconds(1));
std::cout << "signaling children" << std::endl;
condition.notify_all();
}
}
else if(pid > 0)
{ // child process
mutex_type mutex(ip::open_or_create, "test_mutex");
condition_type condition(ip::open_or_create, "test_condition");
while(true)
{
boost::posix_time::ptime wait_time(boost::get_system_time() +
boost::posix_time::seconds(10));
ip::scoped_lock<ip::named_mutex> lock(mutex);
if(condition.timed_wait(lock, wait_time))
std::cout << "got signal from parent" << std::endl;
else
std::cout << "timeout" << std::endl;
}
}
else
{
std::cout << "failed to fork: " << pid << std::endl;
return 1;
}
return 0;
}
- Ngôn ngữ chính
- C++
- Star
- 185
- Fork
- 131
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của boostorg/interprocess
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
boostorg/interprocess#196 · 1 reaction ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
boostorg/interprocess#279 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
boostorg/interprocess#274 · 1 bình luận ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 28/100
boostorg/interprocess#268 · 4 bình luận ·
-
Semaphore use in signals Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
boostorg/interprocess#262 · 2 bình luận ·
Tất cả issue của boostorg/interprocess
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
ros2/message_filters#338 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
subsurface/subsurface#4984 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
flutter-webrtc/flutter-webrtc#2206 ·
-
litertlm-android AAR ships no consumer ProGuard rules → "mid == null" SIGABRT in minified apps Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
google-ai-edge/LiteRT-LM#3739 ·