realbasic-nug
[Top] [All Lists]

Re: what do you actually use threads for?

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: what do you actually use threads for?
From: Charles Yeomans <charles at declareSub dot com>
Date: Wed, 30 Jan 2008 13:07:08 -0500
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <637E97CC-27B0-4CC6-8526-F84F30923F1C at sentman dot com> <1C0C919D-059E-42E8-B883-BCEC24410BDD at inspiringapps dot com>
On Jan 30, 2008, at 12:48 PM, Joe Strout wrote:

> On Jan 30, 2008, at 10:27 AM, James Sentman wrote:
>
>> If I need to do long calculations I use a timer with a tiny period
>> set. Then I find a reasonable amount of time to freeze up the main
>> thread and save off the start ticks and compare in my loop and when
>> I've used say, a quarter of a second I bow out and let the main look
>> process again until the timer is called again and I pick up where I
>> left off.
>>
>> Many such things as that.
>
> Yow.  Those are the things you should consider using threads for;
> they're much easier than what you're currently doing (and probably
> provide a better user experience, too).
>
>> But anything else you can do broken up in the main thread with
>> similar or better performance than in a thread. Or at least you used
>> to be able to.
>
> Sure, you can implement your own crude threading model, but it's a
> lot harder and in most cases is not likely to be better than using
> the built-in one.
>>

This seems more like coroutines (which can also be faked using  
threads, as I understand it).

Charles Yeomans
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>