Python Forum
Newb Question - Threading in Crons
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Newb Question - Threading in Crons
#1
I have been attempting to implement threading in an application I'm working on and I'm starting to wonder if I even need it.

I run python 2.7 on raspberry pi zero. For the last couple of days I have been attempting to get a function to be executed in a multiprocess thread so other operations in python aren't halted. The function is executed in a script file from a cronjob.

The function changes a GPIO pin, then fives minutes later, changes it back. When I am testing the script through file in python interpreter, the script pauses for five minutes, then changes the pin back. This seems like it would halt all other python execution on the machine. If the script file is run from a cronjob, however, are all other python scripting processes halted or does each cronjob execute it's own python thread?

I tried searching for the answer but all of the results have to do with manipulating cronjob using python.
Reply
#2
Every cronjob will start a new python interpreter process and run the pointed script.
So it will not halt other python scripts.
Reply
#3
Thanks for confirmation, I was pretty sure after I pondered on the subject that was the case.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Python newb need help Fictile 1 190 Apr-02-2024, 03:28 AM
Last Post: buran
  Concurrent futures threading running at same speed as non-threading billykid999 13 1,811 May-03-2023, 08:22 AM
Last Post: billykid999
  Tutorials on sockets, threading and multi-threading? muzikman 2 2,113 Oct-01-2021, 08:32 PM
Last Post: muzikman
  NameError issue with daughter's newb code MrGonk 2 1,448 Sep-16-2021, 01:29 PM
Last Post: BashBedlam
  Threading question DPaul 0 1,246 Jun-22-2020, 09:53 AM
Last Post: DPaul
  Simple newb string question Involute 2 2,203 Sep-08-2019, 12:50 AM
Last Post: Involute
  please help this newb install pygame iofhua 7 5,922 May-15-2019, 01:09 PM
Last Post: buran
  Newb question: Debugging + Linting Python in Visual Studio Code Drone4four 1 2,421 Apr-15-2019, 06:19 AM
Last Post: perfringo
  Newb question about %02d %04d bennylava 30 19,415 Mar-05-2019, 11:23 PM
Last Post: snippsat
  Pthyon 3 question (newb) bennylava 11 5,840 Feb-28-2019, 06:04 PM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020