How to start other threads in my application?
Pages: 1 2
Clive Semmens (2335) 3135 posts |
My Daddy was absolutely brill, but he died 24 years ago. Do not try to take this analogy too far. |
Rick Murray (539) 13424 posts |
My daddy was not, and he died around 37 years ago. Or so. Where are we going with this? ;-) |
Clive Semmens (2335) 3135 posts |
Too far, apparently. Or, possibly, Aldershot. |
Reg (3412) 21 posts |
The Wimp2 was last updated in 1999, so I think support for that is not really going to be stellar. I’d appreciate it if all the “daddy” talk could be kept to a minimum. I’m realise I’m new here so I don’t know if this normal behaviour on this forum, but it is distracting. |
Jon Abbott (1421) 2608 posts |
In that case you can forget all the advice above about the Wimp, no you don’t need to remove/replace it. When you run your app it will take over until it exits.
Generate the frame when you receive Event 4 if it needs to be threaded, or wait for VSync via OS_Byte 19 if its running in the foreground task.
Yes, you will need to re-enable IRQ otherwise its likely the machine will lock if IRQ are missed, or you’ll find the keyboard/mouse start acting strangely. You’ll also need to ensure your code can handle re-entrancy. I’d suggest for simplicity: Forground app: wait for network messages / monitor screen touches If you really have to go the thread route, RTSupport is the closest you’ll get to threading, but I’d avoid it if possible as what you’re trying to do doesn’t sound like it needs threading. |
Reg (3412) 21 posts |
@Jon Abbott: Thank you for the response. I think you are correct, if the VSync signal is available as an interrupt and it alows re-enabling IRQs/FIQs then I don’t really need threading at all. I’ll abandon that idea now. Re re-entrancy: I guess that is just for completeness because if I can ensure that the redraw/tagging is completed in a timely manner within one frame time then I can’t imagine it being re-entered. Anyhow, it is easy to set a flag when it is busy and simply return if another interrupt is triggered. I could guess that in that case I might have not yet completed the previous frame which would be a serious error in my situation so perhaps I can use something like that to detect a problem. |
Pages: 1 2