Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!howland.reston.ans.net!ix.netcom.com!netcom.com!davido
From: davido@netcom.com (David Ornstein)
Subject: Re: API calls inseparate threads? (Was: Re: Multithreading)
Message-ID: <davidoCzCsz7.Kww@netcom.com>
Organization: NETCOM On-line Communication Services (408 261-4700 guest)
References: <CyyHLD.BIo@world.std.com> <LGM.94Nov13173410@polaris.ih.att.com> <knight.784792765@tina.mrco.carleton.ca> <patrick_d_logan.211.000EDC1F@ccm.jf.intel.com>
Date: Wed, 16 Nov 1994 09:28:19 GMT
Lines: 38

In article <patrick_d_logan.211.000EDC1F@ccm.jf.intel.com>,
Patrick D. Logan <patrick_d_logan@ccm.jf.intel.com> wrote:
>In article <knight.784792765@tina.mrco.carleton.ca> knight@mrco.carleton.ca (Alan Knight) writes:
>
>>If you can run API calls in a separate thread, as IBM can and Digitalk
>>either can or will be able to soon, then this is not a problem. I
>>think the overhead is very small. The major disadvantage is the
>>inability to take advantage of OS facilities for distributing threads
>>to multiple processors.
>
>I do not understand how "run API calls in a separate thread" works. What 
>happens to the result of the API call? Examples, anyone?

I can only speak for Digitalk's threading support.  In the upcoming 3.0 
release, you start an API call, specifying that it should run in its own 
thread.  You can also specify actions to be taken (any Smalltalk code) 
when the thread completes.

>What if I want to wait for some input and run some Smalltalk code as a result 
>in the background?

You would do an API call (e.g., to wait for data to arrive over a 
named-pipe) and then continue with your normal Smalltalk processing.  You 
could poll the API call that you started to see when it finished or you 
could (as mentioned above) just attach code to the API call you did that 
will get run automatically when the API call completes.

>Doesn't anyone think having multiple, simultaneous threads of Smalltalk code 
>is a good thing?

Many people do (me included!)  It's just a hard problem.


-- 
=============================================================================
David Ornstein          Moon in a barrel:           Itsu nukeru
davido@netcom.com       you never know just when    soko tomo shirazu
voice: 415-552-3262     the bottom will fall out    oke no tsuki
                           Death Poem - Mabutsu        Jisei - Mabutsu
