Bottom Page

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.
Quote
#2
Every cronjob will start a new python interpreter process and run the pointed script.
So it will not halt other python scripts.
nilamo likes this post
Quote
#3
Thanks for confirmation, I was pretty sure after I pondered on the subject that was the case.
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Simple newb string question Involute 2 310 Sep-08-2019, 12:50 AM
Last Post: Involute
  please help this newb install pygame iofhua 7 988 May-15-2019, 01:09 PM
Last Post: buran
  Newb question: Debugging + Linting Python in Visual Studio Code Drone4four 1 400 Apr-15-2019, 06:19 AM
Last Post: perfringo
  Newb question about %02d %04d bennylava 30 4,059 Mar-05-2019, 11:23 PM
Last Post: snippsat
  Pthyon 3 question (newb) bennylava 11 1,055 Feb-28-2019, 06:04 PM
Last Post: buran
  newb selfie PatM 5 576 Feb-19-2019, 12:20 AM
Last Post: snippsat
  Complete NEWB and openpyxl project Netopia 44 3,750 Jan-18-2019, 08:15 PM
Last Post: Netopia
  Matt's newb question 1 MattSS102 1 1,008 Aug-28-2017, 03:27 AM
Last Post: BerlingSwe
  Newb: Simple Explicit Formula Duplicitous 1 1,224 May-05-2017, 07:03 PM
Last Post: buran

Forum Jump:


Users browsing this thread: 1 Guest(s)