Question regarding the patch: Fix a race condition in timer_queue.cc

18 views
Skip to first unread message

Chuang-Yu Cheng

unread,
Jun 30, 2020, 7:09:51 PM6/30/20
to TensorFlow Runtime
Hi,

Not sure if this is the right place to open this discussion.

I read the patch which fix a race condition between TimerThreadRun and ~TimerQueue.

I think it is safe to keep original code for ~TimerQueue:
  mu_.unlock();
  cv_.notify_one();
Enter code here...

Because in TimerThreadRun, it locks the mutex at the beginning, so it prevents the race condition.

Or TFRT doesn't like unlock then notify pattern?

Thanks,
CY

Chuang-Yu Cheng

unread,
Jul 1, 2020, 5:33:09 PM7/1/20
to TensorFlow Runtime
Reply all
Reply to author
Forward
0 new messages