Previous | Next --- Slide 15 of 81
Back to Lecture Thumbnails
suninhouse

It appears that the multithreading part of GraphLab is implemented via fiber, how is this different from threads? https://github.com/kikohs/graphlab/blob/master/src/graphlab/parallel/fiber_control.hpp

haiyuem

The backend implementation for GraphLab might be something like this: execute each function as a parallel loop, and place a barrier in between each function.

jle

@suninhouse, it seems like the main difference is that thread use “pre-emptive” scheduling and fibers use “cooperative” scheduling. I believe this means threads can be interrupted (be preempted) and end execution at any point, and other threads can take over—leading to problems like race conditions with the data it may be accessing. On the other hand, fibers can only be interrupted and ended when it yields execution—meaning you know when fibers will start and stop. I believe this means fibers are not exactly concurrent. https://stackoverflow.com/questions/796217/what-is-the-difference-between-a-thread-and-a-fiber

https://www.rapitasystems.com/blog/what-are-co-operative-and-pre-emptive-scheduling-algorithms

However, I don’t have a great understanding as to why GraphLab uses fibers. If someone could speak to that, that’d be cool!

Please log in to leave a comment.