Assert on: ctx->remote_ready_is_linked() on cond_var.wait_for(..)
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 28/100
- Tipo de issue
- Error
- Claridad
- Necesita aclaración
- Estado de actividad
- Estancado
- Stack tecnológico
- cpp
- Área
- operating-systems
Línea de trabajo
Comienza en scheduler::sleep2ready_() y sigue la ruta de cond_var.wait_for(), comparándola con cond_var.wait(), especialmente cómo las activaciones del temporizador y notify_all() entre hilos afectan a los enlaces remote-ready. Reproduce la aserción con Boost 1.69, shared_work, un hilo round_robin externo y las aserciones habilitadas; el trabajo estará terminado cuando el escenario indicado ya no infrinja la aserción o su comportamiento esperado esté documentado.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Situation:
0. I use boost 1.69
- Have one thread pool (TP) with shared_work algo started on it.
- fibers running in TP is waiting on cond_var:
boost::fibers::mutex _mtx;
boost::fibers::condition_variable _condition;
...
std::unique_lock lock{ _mtx };
if (!_condition.wait_for(lock, WaitTimeout(), GetWaitPredicate()))
throw std::runtime_error{ __FUNCTION__": pontentially lost" };
- I Have other threads (not in thread pool, round_robin default scheduler). Where I notify cv:
std::unique_lock lock{ _mtx };
// fullfill predicate somehow:
_condition.notify_all();
If I build the program with assertions I got very fast the assert:
void
scheduler::sleep2ready_() noexcept {
// move context which the deadline has reached
// to ready-queue
// sleep-queue is sorted (ascending)
std::chrono::steady_clock::time_point now = std::chrono::steady_clock::now();
sleep_queue_type::iterator e = sleep_queue_.end();
for ( sleep_queue_type::iterator i = sleep_queue_.begin(); i != e;) {
context * ctx = & ( * i);
// dipatcher context must never be pushed to sleep-queue
BOOST_ASSERT( ! ctx->is_context( type::dispatcher_context) );
BOOST_ASSERT( main_ctx_ == ctx || ctx->worker_is_linked() );
BOOST_ASSERT( ! ctx->ready_is_linked() );
#if ! defined(BOOST_FIBERS_NO_ATOMICS)
BOOST_ASSERT( ! ctx->remote_ready_is_linked() ); <---- THIS ASSERT
#endif
...
As far As I understand the fiber can be waked up by timer or by notification from another thread and this is not allowed by this assert. How can I fix the issue?
P.S. When I changed wait_for() -> wait() the assert is gone!
Thanks!
- Lenguaje dominante
- C++
- Estrellas
- 512
- Forks
- 124
- Merge medio
- 23 d 19 h
- PR fusionados (30 d)
- 1
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de boostorg/fiber
-
Dificultad 4/5 3-5 días Aptitud para principiantes 20/100
-
Boost\libs\fiber\test failed to build due to error C2039 with /std:c++latest option on WindowsAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 42/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
Todos los issues de boostorg/fiber
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
pocoproject/poco#5626 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
Issue-Bug Needs-Triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
microsoft/winget-cli#6645 ·
Los mantenedores suelen responder en 2 días
-
cleanup help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
ESPresense/ESPresense#2602 ·
Los mantenedores suelen responder en 1 día
-
devex good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día