1. A method, comprising: receiving a code including multi-thread and non-multi-thread portions; determining, by a compiler, whether the multi-thread portion of the code are being received; and generating a schedule for the multi-thread portions of the code, in response to the determining that the multi-thread portion is being received, by a cross-thread scheduler of the compiler, by: identifying a plurality of operations in the multi-thread portion of the code that are unscheduled, selecting a plurality of critical operations from the plurality of operations, each critical operation being an operation that contributes to a critical path or utilizes a critical resource, prioritizing the plurality of critical operations, each critical operation including a corresponding latency, according to a length of each corresponding latency, and assigning the plurality of operations in an alternating resource pattern to the schedule according to the prioritizing.