The setup is the following: I have to run a certain amount of tasks. Each task takes a different amount of time to complete and has a separate deadline to make. I can run at most N tasks in parallel (N is about 10-20, but I ignore if it being big or small has any consequence on the solution). Also, there are fixed periodic time windows in which tasks cannot begin, and they occur simultaneously for every parallel thread. This means that if a task ends just after the forbidden window starts, I might miss out on considerable working time, which is undesirable. This might also happen if the forbidden window is about to begin and I start a short task. So it is perhaps more efficient to start a long task which is due for later and only after start a task which is due for earlier, as long as both of them are completed before their respective deadlines.
The question is: is there a sorting algorith that will help me solve this problem efficiently? In short, given a certain number of tasks to run, each with a certain time and deadline, is ther an efficient algorithm that will solve the problem of where to start each task (thread and position in thread)? For now, having it solve for 100 tasks and 10 threads is good, but ideally it would need to be scalable, up to say 5k tasks and ~100 threads.
I am a physics major so I have no clue about sorting algorithms, hope you can help. Thanks in advance!