You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following gist contains two examples, the first one produces no output, the second does.
From the docs I couldn't find any reasons why doing a std::thread::spawn inside a crossbeam::scope(|s| s.spawn(|| std::thread::spawn(|| ...)) should be necessary.
Because your threading logic is wrong - from the indicatif documentation for join():
Waits for all progress bars to report that they are finished.
You need to call this as this will request the draw instructions from the remote progress bars. Not calling this will deadlock your program.
So you need to call join() or join_and_clear() for indicatif to display your progress bar, but you call it after the crossbeam::scope exits, which means that all the work has already been done, because crossbeam::scope joins all threads which were created in it before it can exit.
On the other hand, in works.rs you spawn a detached thread, which can keep going after the crossbeam::scope is over, so that the join call displays the detached thread's progress.
The following gist contains two examples, the first one produces no output, the second does.
From the docs I couldn't find any reasons why doing a std::thread::spawn inside a
crossbeam::scope(|s| s.spawn(|| std::thread::spawn(|| ...))
should be necessary.https://gist.github.com/gnzlbg/09d7e546df2215bee83fc5fe02840292
The text was updated successfully, but these errors were encountered: