Hi Jens,
Thank you for your clarifications. I had been left with an unsettled feeling
about the technique.
On 25/5/08, Jens Alfke wrote:
> On 25 May '08, at 2:40 AM, Thomas Davie wrote:
>
> >I hate to say this, but any form of delay here is the *wrong*
> >way to do this. You already know yo
On 25 May '08, at 2:40 AM, Thomas Davie wrote:
I hate to say this, but any form of delay here is the *wrong* way to
do this. You already know you have a race condition, all you're
doing is making it so the race condition will work out in your favor
99.99% of the time. There are still exc
Hi Dimitri,
Thanks for your insightful reply.
On 25/5/08, Dmitri Goutnik wrote:
Have to agree with Thomas that delay is the wrong way to handle this.
Yes, he makes a good point.
From 10.4 on fetch: results are delayed until the next iteration of
the run loop so (please correct me if I'm wr
Hi Ken,
On 25/5/08, Ken Thomases wrote:
Just for posterity, there's also the simpler, more efficient [NSThread
sleepForTimeInterval:0.1]. The documentation says it's only available
in 10.5 and later, but the 10.5 release notes say that it was always
available but only recently published in the
Hi Bob at [EMAIL PROTECTED] (Thomas Davie)
On 25/5/08, Thomas Davie wrote:
I hate to say this, but any form of delay here is the *wrong* way to
do this. You already know you have a race condition, all you're doing
is making it so the race condition will work out in your favor 99.99%
of the tim
Sorry, forgot to hit Reply All..
On May 25, 2008, at 10:45 AM, Steve Steinitz wrote:
Hello,
This is hard to google for because they are such common words:
how do I delay, wait, pause for a tenth of a second?
I don't want to use NSTimer because I just want to resume where I
left off. I don
This is an important consideration. If you're relying on a specific
event to finish within a finite amount of time, you're going to have a
race condition where the event could finish later than expected and
you may end up in an invalid state.
Perhaps if you told us what it is you're specif
On May 25, 2008, at 4:22 AM, Steve Steinitz wrote:
NSDate *future = [NSDate dateWithTimeIntervalSinceNow: 0.1];
[NSThread sleepUntilDate:future];
Just for posterity, there's also the simpler, more efficient [NSThread
sleepForTimeInterval:0.1]. The documentation says it's only availabl
On 25 May 2008, at 11:22, Steve Steinitz wrote:
Hello,
Thank you Jens Alfke, Peter Burtis and Stephen Joseph Butler for
your excellent, quick and helpful replies.
[SNIP]
from your method. Stephen warns that the host method needs to be re-
entrant or guard against multiple entries.
I
Hello,
Thank you Jens Alfke, Peter Burtis and Stephen Joseph Butler for
your excellent, quick and helpful replies.
Thank you Jens for the heads up about the threading and for
letting me know that things are done this way in Cocoa -- I just
didn't want to be out in left field.
Below. for fu
On Sun, May 25, 2008 at 1:45 AM, Steve Steinitz
<[EMAIL PROTECTED]> wrote:
> Hello,
>
> This is hard to google for because they are such common words:
>
> how do I delay, wait, pause for a tenth of a second?
Hmm... someone correct me if I'm wrong, but I believe the run loop is
re-enterable. So you
There's usleep, but sleeping a thread just for a very small amount of
time in a loop is gonna force a context switch every iteration and
really hurt performance. It might be better to poll or spin.
On May 25, 2008, at 12:45 AM, Steve Steinitz wrote:
This is hard to google for beca
On 24 May '08, at 11:45 PM, Steve Steinitz wrote:
I don't want to use NSTimer because I just want to resume where I
left off. I don't want to be in a tight loop because I need the
system to finish something. I just want to pause execution for a
short time. I think there was a wait() in
NSThread has a sleepUntilDate: class method.
In the example below, 0.1 = 1/10th of a second.
NSDate *future = [NSDate dateWithTimeIntervalSinceNow: 0.1 ];
[NSThread sleepUntilDate:future];
-Pete
On May 25, 2008, at 2:45 AM, Steve Steinitz wrote:
Hello,
This is hard to googl
Hello,
This is hard to google for because they are such common words:
how do I delay, wait, pause for a tenth of a second?
I don't want to use NSTimer because I just want to resume where
I left off. I don't want to be in a tight loop because I need
the system to finish something. I just wan
15 matches
Mail list logo