简体   繁体   中英

Python script to run same script by multiple users

I have Python scripts in Linux Server.

I have multiple scripts in directory example /home/python/scripts

all users use same username "python" to login linux server.

If multiple users are run same script is there any issues?

Like if one user start execute one script before finishing this script another user also started same script. Is variable got overwrite ?

What is best way to handle this kind of things.

So long as the state is not shared in any way between the different interpreters executing the scripts (re each user running the script gets a different Python interpreter process), there should be no problem. However if there is some shared context (such as a log file each process is simultaneously reading/writing from assuming mutual exclusivity), you will very likely have trouble. The trouble could be mitigated in many ways whether through mutexes or other synchronized access.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM