Parallel Threading vs Serial Threading in Mechanical ACT
Ayush Kumar
Member, Moderator, Employee Posts: 442
✭✭✭✭
in Structures
Comments
-
Parallel Threading: The control moves over to the rest of the code, while part of the code is executed in a parallel thread.
Please note the "," after the 2nd argument is crucial.
Example:
import threading msg_string = "Test String" def show_info(message): MessageBox.Show(message) thread = threading.Thread(target=show_info, args=(msg_string,)) thread.start()
Serial Threading: The control pauses till the user clicks OK in the MessageBox but the set of commands is executed in a separate thread.
Example:
msg_string = "Test String" def show_info(message): MessageBox.Show(message) ExtAPI.Application.InvokeUIThread(show_info, msg_string)
2