Re: How to set scheduling in NSThread based application
Re: How to set scheduling in NSThread based application
- Subject: Re: How to set scheduling in NSThread based application
- From: "Shawn Erickson" <email@hidden>
- Date: Mon, 12 Feb 2007 08:57:12 -0800
On 2/12/07, Shawn Erickson <email@hidden> wrote:
On 2/12/07, Gilles Celli <email@hidden> wrote:
> Hi,
>
> I've written a data acquisition-program under Cocoa which detach 2
> new NSThreads:
>
> One which collects data every 0.5 seconds (full second and
> millisecond 500 via gettimeofday()) from a multimeter via USB-to-
> Serial Adapter,
> and another one which displays the graph of the data in NSTableView
> and with the Open-Source-Based
> SM2DGraphView.
...snip...
> Any suggestions are greatly appreciated.
500 milliseconds is 50 times larger then the current scheduling
quantum. I really don't think thread scheduling is an issue.... unless
you have to capture something in a relatively narrow time period (i.e.
500 ms +/- a few to 10s of milliseconds).
Are you sure you are not affected by clock skew introduced in the way
you are calculating times? Or by some contested lock you are using to
protect the data you are capturing and displaying?
Another possibility, not knowing how your capture thread is coded, is
that your capture thread is chewing to much CPU time (polling to
quickly) and as a result its priority gets suppressed due to fairness
and every now and then due to it lower priority loses out to another
thread with higher priority at just the wrong time.
-Shawn
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden