Jump to content




Basic multitasking (keeping a clock running in the background)


  • You cannot reply to this topic
3 replies to this topic

#1 Nothy

  • Members
  • 249 posts
  • LocationMars

Posted 02 March 2016 - 12:19 PM

(solved)
Disclaimer: I'm a bit of a noob when it comes to the parallel api.

Okay, so. Basically what I'm trying to do is keep a clock running in my OS.
I set the clock position based on what "state" the OS is in. As in, if the OS is in "home", then the clock would be in 1,1. If that makes sense.

But if I call the clock to render in the same function as the screen to update where the user clicked, it will pause the clock updating.

And if I use the parallel API, I run into the issue where it just simply does not work.
The screen will allow one click, no more.
The clock will refresh once, no more.

So I'm wondering, what would be a possible solution?
Code

Edited by Nothy, 03 March 2016 - 07:48 AM.


#2 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 02 March 2016 - 01:14 PM

Don't run parallel.waitForAny() within a while loop; put while loops into your time and lockscreen functions instead.

#3 Nothy

  • Members
  • 249 posts
  • LocationMars

Posted 02 March 2016 - 01:21 PM

View PostBomb Bloke, on 02 March 2016 - 01:14 PM, said:

Don't run parallel.waitForAny() within a while loop; put while loops into your time and lockscreen functions instead.
Alrighty. I'll try. Thank you :)

#4 Nothy

  • Members
  • 249 posts
  • LocationMars

Posted 02 March 2016 - 08:20 PM

It works very well. Thank you so, so much.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users