Opened 5 years ago

Last modified 5 years ago

#4185 closed defect

ChimeraX bug report submission — at Initial Version

Reported by: Andrei Istrate Owned by:
Priority: normal Milestone: 1.3
Component: Core Version:
Keywords: Cc: chimera-programmers
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

The following bug report has been submitted:
Platform:        macOS-10.16-x86_64-i386-64bit
ChimeraX Version: 1.2.dev202101090324 (2021-01-09 03:24:40 UTC)
Description
There is a problem with using multiprocessing in scripts ran by ChimeraX after the update from Python 3.7 to Python 3.8 on mac.

The problem comes from the requirement to protect the “entry point” of the program by using if __name__ == '__main__'

Like this:

from multiprocessing import Process

def slave(a):
    print(a)

if __name__ == '__main__':
    thread_list = []
    for i in range(4):
        t = Process(target=slave, args=(i,))
        thread_list.append(t)
    for thread in thread_list:
        thread.start()
    for thread in thread_list:
        thread.join()

Change History (0)

Note: See TracTickets for help on using tickets.