Thread Execution Order

Priyanka discusses the complexities of instruction reordering within single-threaded versus multi-threaded environments. She highlights the risks associated with partially initialized objects when multiple threads are involved, leading to unpredictable errors. The introduction of the volatile keyword is explained as a solution to ensure that variables remain consistent and visible across threads, emphasizing the intricacies of the Java memory model and its limitations.