Re: Priotiry
Re: Priotiry
- Subject: Re: Priotiry
- From: Alastair Houghton <email@hidden>
- Date: Fri, 20 Feb 2004 12:30:47 +0000
On 8 Feb 2004, at 21:53, email@hidden wrote:
>
Well I have a method which is very sensitive, and sharing processor
>
time
>
can cause problems. Espcially if lots of apps are running and the app
>
caches something in the swap file.
There are two things you should do here:
1. Use real-time threads. Mac OS X has a real-time scheduler,
including support for time constraints, so use it.
2. mlock() anything that you need to use in your real-time threads.
That way your threads won't block trying to page something in.
Take a look at this page to see how to use a real-time thread:
http://developer.apple.com/documentation/Darwin/Conceptual/
KernelProgramming/scheduler/chapter_8_section_4.html
(hint: look at the set_realtime() function)
Remember... the solution is not to try to take complete control of the
machine, the solution is to decide *how often* you need control of the
machine and for how long you're going to run on each occasion. That
way, the user can carry on working with the machine, background tasks
can continue to run, but you still get the time you need.
BTW, this isn't really a Cocoa question :-)
Kind regards,
Alastair.
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
References: | |
| >Priotiry (From: email@hidden) |