You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
Use the static scheduler in ordered clause. Otherwise OpenMP uses
a scheduler it thinks is best which can be dynamic or guided. Both sometimes let other threads continue before the block is finished. That will crash the program with high thread counts and a cache that is not large enough to hold old enough frames, which leads to a crash when in some cases like transitions two different frames are used although one is no longer in the cache. The static scheduler always waits until the block is finished before enabling other threads.
This commit is contained in:
@@ -717,7 +717,8 @@ std::shared_ptr<Frame> Timeline::GetFrame(int64_t requested_frame)
|
||||
#pragma omp parallel
|
||||
{
|
||||
// Loop through all requested frames
|
||||
#pragma omp for ordered firstprivate(nearby_clips, requested_frame, minimum_frames)
|
||||
// The scheduler has to be static!
|
||||
#pragma omp for ordered schedule(static,1) firstprivate(nearby_clips, requested_frame, minimum_frames)
|
||||
for (int64_t frame_number = requested_frame; frame_number < requested_frame + minimum_frames; frame_number++)
|
||||
{
|
||||
// Debug output
|
||||
|
||||
Reference in New Issue
Block a user