Thread
:
[WIP] Immoral - a Py/QML mail client.
View Single Post
SPARTAN563
2011-06-07 , 10:04
Posts: 92 | Thanked: 92 times | Joined on May 2011 @ Stellenbosch, South Africa
#
33
Hi,
Sounds like you're making some good progress, despite the scourge that is exams
What I understand with regards to threading (bear in mind this is coming off a Win32/C# background) is that the following happens: for each core in the device a single (not necessarily your application's thread) can be run at any one time. i.e. if you have a dual core processor then 2 threads can be run concurrently without blocking one another. What the OS/Kernel does is simply blocks threads as required to give the illusion that they are all running simultaneously.
So, on the N900 (with it's little single core processor) you can run at most 1 thread at any one time. The best way to allow a "multithreading" system to work then is to make sure that the operating system prioritises your UI threads and other such things above your worker threads, this will lead to your worker threads being blocked more often and a bit of a general slowdown in terms of processing speed BUT your UI should remain perfectly usable while that is happening. Another alternative, without dropping the priority of your worker threads, is to make use of Sleep() function calls within them whenever they are likely to have nothing to do for a bit. Those Sleep() calls will be intercepted by the kernel and it will block that thread's execution for as long as it needs to in order to allow other threads to get some work done.
Just another thing that you may not expect when coding a multithreaded app is that the user is likely to go "usable UI = can do stuff", which from a coding perspective isn't always the case. You may want to make sure that your app can handle multiple different operations at the same time, say the user opening one email, then deciding that actually that wasn't the one they wanted and clicking on a different one (while your background thread would be loading the email they clicked on).
Overall though, good luck and I really look forward to being able to test it out, it certainly sounds impressive
Best Regards,
SPARTAN563
Quote & Reply
|
SPARTAN563
View Public Profile
Send a private message to SPARTAN563
Visit SPARTAN563's homepage!
Find all posts by SPARTAN563