Objective-C Issues

multiple-threads

People ( From: lines )
 bradcox@sitevax.gmu.edu (Brad Cox)
 Bruce Nilo 
 rms@gnu.ai.mit.edu (Richard Stallman)
Subjects ( 3 mails )
 Re: Your mission, should you choose to accept it. . .
 Action Expressions (exception handling, multitasking)
 action expressions
Document
Date: Thu, 10 Sep 1992 15:12:40 -0700
From: Bruce Nilo 
To: gnu-objc@prep.ai.mit.edu
Subject: Re: Your mission, should you choose to accept it. . .

[moved PROTOCOL IMPROVEMENT]
[moved ERROR HANDLING]

BETTER RUNTIME SUPPORT FOR MULTI-THREADED PROGRAMS

Practically every program I have written on the NeXT has either been
explicitly or implicitly multi-threaded. Any OS which supports
multi-tasking within the same address space should at least attempt to
support a runtime system which does not penalize the use of multiple
threads. Even if this cannot be done transparently, low level runtime
calls could be made to set up private thread caches etc. Using a
hammer to provide thread safety, such as providing a semaphore on a
global cache, should be used only if it is reasonably certain that
this approach has message dispatching performance competitive with
other implementations.

Perhaps NeXT's approach is a near optimal solution. I find this hard
to believe however, and suspect that in reality not much thought has
been given to the problem.

[moved GENERAL DATA STRUCTURES]

- Bruce D. Nilo

VP Software Systems
ICTV

Date: Mon, 12 Oct 1992 13:46:03 -0500
To: gnu-objc@prep.ai.mit.edu
From: bradcox@sitevax.gmu.edu (Brad Cox)
Subject: Action Expressions (exception handling, multitasking)
Cc: Bruce Nilo 

In Re: Your mission, should you choose to accept it. . Bruce Nilo
 writes

NeXT has half heartedly implemented an "Exception Handling" facility.  
It basically consists of some macros, and the use of setjmp() and  
longjmp(). An error handling facility should be specified,  
implemented, and adhered to throughout the runtime system.

I agree wholeheartedly! I joined this list primarily to encourage
extensions to Objective-C of precisely this nature.

I made substantial progress on the run-time part of this problem at Stepstone
several years ago, but never managed to complete the language extensions
(upwards compatible) to make them broadly useful. 

 "Action expressions in Objective-C are similar to
block expressions in Smalltalk, with differences to adapt to the
constraints of stack-based languages like C. Action expressions are a way
to express actions, or deferred computations; computations to be written at
one place but invoked from another."

This document, which describes the (implemented) runtime components and
(unimplemented) syntactic extensions, would be useful in considering
language and/or runtime extensions. 

I'll be glad to email a copy to those planning to  work on such extentions. 
(Please...only if you're planning to do actual work!)
===
Brad Cox, Ph.D; Program on Social and Organizational Learning; George Mason
University; Fairfax VA 22030; 703 691 3187 direct; 703 993 1142 reception;
bradcox@sitevax.gmu.edu
---
Information Age Consulting; 13668 Bent Tree Circle #203; Centreville VA
22020;           703 968 8229 home; 703 968 8798 fax; bradcox@infoage.com

Date: Thu, 15 Oct 92 04:59:00 -0400
From: rms@gnu.ai.mit.edu (Richard Stallman)
To: gsk@marble.com
Cc: gnu-objc@prep.ai.mit.edu
Subject: action expressions

GNU C supports nested functions.  In 2.3, these should work in
Objective C.  This supplies most of the mechanism for creating action
objects if you want them.  In fact, I expect one can go the rest of
the way with macros, if you don't mind a different syntax:

#define make_action(name, body)
 ({ id __temp = ;
    void name () { body }
    ;
    __temp; })

I've omitted the backslashes, and left stubs for where Objective C
constructs are needed since I don't know them.

This technique requires you to give a unique name each time you write
an action expression.  That could be avoided with an improvement in
macro power.

Statistics
 filename:           multiple-threads
 number of mails:    3
 number of writers:  3
 line count:         97
 word count:         574
 character count:    3827

created by Helge Hess ( helge@mdlink.de )
MDlink online service center ( www.mdlink.de )