What happens if APScheduler runs two jobs that call the same function at the same time?

148 views
Skip to first unread message

Braun Brelin

unread,
May 9, 2013, 11:16:47 AM5/9/13
to apsch...@googlegroups.com
Does APScheduler have a way of queuing jobs that are called at the same time with the same callback function?  If, for example
my call back function queries a serial port, then there will be race conditions involved with both instances of the function
trying to get access to the serial port...Will I have to call the function in a thread and lock the critical portions of the function code myself?
 
Thanks,
 
Braun Brelin
 

Alex Grönholm

unread,
May 9, 2013, 11:37:37 AM5/9/13
to apsch...@googlegroups.com
APScheduler already uses a thread pool to execute the callbacks. If you
have two different jobs that execute code that accesses some shared
resource, you need to handle that with explicit locking.
> Thanks,
> Braun Brelin
> --
> You received this message because you are subscribed to the Google
> Groups "APScheduler" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to apscheduler...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Reply all
Reply to author
Forward
0 new messages