TweetFollow Us on Twitter

November 93 - BAMADA Notes

BAMADA Notes

Robert Lenoil

The October BAMADA meeting featured Eric Anderson, author of Apple's Thread Manager package, and Bo Klintberg, author of Software Framework Association's soon-to-be-released OSL Scripting Components product. (There was a September meeting, but I unfortunately couldn't attend, and therefore can't report on the proceedings.)

Thread Manager

The Thread Manager is a Macintosh system extension that provides for multiple threads of execution within a single application. Multi-threaded is all the rage nowadays: Windows NT does it; OS/2 has been doing it; and like so many other "new" features in desktop computer operating systems, many flavors of UNIX have been doing it for years. Now, thanks to the efforts of Eric Anderson and company, you can use the threads model of programming on the Macintosh too.

A thread is a lightweight task within a process that shares all the process's resources (open files, address space, etc.). Basically, a thread is just a private stack and a saved program counter and registers. As context switches go, switching between two threads is fast. When you have a time consuming task to perform or are doing polled or asynchronous i/o, create a separate thread to perform the activity. Periodically or while waiting for i/o, your thread sleeps to allow other threads to run; this lets your program maintain a responsive user interface without the tedious effort of state machine-based background processing from the main event loop, à la MacApp cohandlers or similar mechanisms.

Version 1.2 of Thread Manager is on Apple's November Developer CD. It is not the thread manager described in issue 6 of Apple's d e v e l o p magazine (that thread manager was unsupported and is now obsolete) but the concepts discussed in that article do apply. It can be shipped with your commercial programs for a nominal licensing fee. Also on the developer CD is Voodoo Monkey, a threads-aware debugger (the Debugger from Jasik Designs also knows about Thread Manager); and a utility package that adds semaphores and other features built on top of the basic Thread Manager API.

Thread Manager supports two styles of thread: cooperative and preemptive. Cooperative threads are scheduled at WaitNextEvent time. The default scheduler calls all runnable cooperative threads in a round robin fashion, with special provision for activating the main thread (the initial thread, which will handle your main event loop) whenever an event is available in the OS event queue. Preemptive threads are preemptively multitasked, which means that they run until they yield to another thread or until their time quantum expires. Preemptive threads must follow the rules for code that executes at interrupt time, namely, they cannot call any trap that can cause memory to be moved and they must not call traps where reentrancy is a concern. Preemptive threads are ideal for porting bulky number crunching algorithms to the Macintosh; without any coding changes the main thread will still get processor time and allow the user interface to operate while the computation occurs in the background. Tom Becker demonstrated this technique to the audience with a thread-based version of FracApp, a program which computes and displays the Mandelbrot set.

Threads Manager does have some limitations. For starters, it is only available for applications; not for desk accessories, INITs, or drivers. Thread switching only occurs when the target application is given time by the Process Manager. Since the Process Manager uses a cooperative multiprocessing model, threads - even preemptive ones - can be kept waiting for indefinite periods of time by unfriendly foreground applications. Last, but not least, Eric Anderson announced that preemptive threads will not be supported for native mode applications on PowerPC Macintoshes. So unless you plan on running your applications on PowerPC only in 680x0 emulation mode, you should not use preemptive threads.

OSL Scripting Components

Bo Klintberg spoke to the BAMADA audience as part of his US tour of MADA affiliates. Bo hails from Sweden, where he is hard at work putting the finishing touches on his AppleEvent/AppleScript support library for MacApp. The package is very complete, with a format modeled after MacApp's. It comes with source code (C++), sample apps, an introductory guide, cookbook, class and method reference, 411 help files, and an OSL Scripting Suite reference. The documentation comes to over three hundred pages. Unlike Ken Ryall's MAScript package, which modifies the MacApp source code to add AppleEvent support to existing MacApp classes, OSL Scripting Components leaves the MacApp code untouched and provides a whole new set of classes for dealing with AppleEvents. There are separate classes for client events (which send requests) and server events (which respond to requests). To support a new AppleEvent, your subclass must override the PrepareMessage and ReplyComplete methods; most of the other work is handled for you.

OSL Scripting Components will come with demo applications for an AppleEvent client, an AppleEvent server, and an AppleScript recordable application. In the future, Bo would like to add handlers for the AppleEvent table and database suites. Personally, I wanted him to hurry up and get back to Sweden so that we could get this package sooner; it looks like a winner for AppleEvent and AppleScript programming in MacApp. Hopefully by the time you read this Software Frameworks Association will have announced availability and pricing.

Next time…

BAMADA meets the first Thursday of each month at 7pm at 4 Infinite Loop in Apple's R&D campus in Cupertino. At the November meeting, members of Apple's MacApp team will discuss the upcoming 3.1 release. Also, Tom Becker will be giving a demonstrations on drag and drop, and show a new class that does it for you with no code additions. If you're interested in speaking at an upcoming meeting, or want to be placed on the mailing list for BAMADA announcements, contact Eric Hanig or Tom Becker at ABI.FC (AppleLink), Eric_Hanig@apldbio.com (Internet), or call 800-874-9869 extension 8902.

 
AAPL
$119.00
Apple Inc.
+1.40
MSFT
$47.75
Microsoft Corpora
+0.28
GOOG
$540.37
Google Inc.
-0.71

MacTech Search:
Community Search:

Software Updates via MacUpdate

HoudahSpot 3.9.6 - Advanced file search...
HoudahSpot is a powerful file search tool built upon MacOS X Spotlight. Spotlight unleashed Create detailed queries to locate the exact file you need Narrow down searches. Zero in on files Save... Read more
RapidWeaver 6.0.3 - Create template-base...
RapidWeaver is a next-generation Web design application to help you easily create professional-looking Web sites in minutes. No knowledge of complex code is required, RapidWeaver will take care of... Read more
iPhoto Library Manager 4.1.10 - Manage m...
iPhoto Library Manager lets you organize your photos into multiple iPhoto libraries. Separate your high school and college photos from your latest summer vacation pictures. Or keep some photo... Read more
iExplorer 3.5.1.9 - View and transfer al...
iExplorer is an iPhone browser for Mac lets you view the files on your iOS device. By using a drag and drop interface, you can quickly copy files and folders between your Mac and your iPhone or... Read more
MacUpdate Desktop 6.0.3 - Discover and i...
MacUpdate Desktop 6 brings seamless 1-click installs and version updates to your Mac. With a free MacUpdate account and MacUpdate Desktop 6, Mac users can now install almost any Mac app on macupdate.... Read more
SteerMouse 4.2.2 - Powerful third-party...
SteerMouse is an advanced driver for USB and Bluetooth mice. It also supports Apple Mighty Mouse very well. SteerMouse can assign various functions to buttons that Apple's software does not allow,... Read more
iMazing 1.1 - Complete iOS device manage...
iMazing (was DiskAid) is the ultimate iOS device manager with capabilities far beyond what iTunes offers. With iMazing and your iOS device (iPhone, iPad, or iPod), you can: Copy music to and from... Read more
PopChar X 7.0 - Floating window shows av...
PopChar X helps you get the most out of your font collection. With its crystal-clear interface, PopChar X provides a frustration-free way to access any font's special characters. Expanded... Read more
Carbon Copy Cloner 4.0.3 - Easy-to-use b...
Carbon Copy Cloner backups are better than ordinary backups. Suppose the unthinkable happens while you're under deadline to finish a project: your Mac is unresponsive and all you hear is an ominous,... Read more
ForeverSave 2.1.3 - Universal auto-save...
ForeverSave auto-saves all documents you're working on while simultaneously doing backup versioning in the background. Lost data can be quickly restored at any time. Losing data, caused by... Read more

Latest Forum Discussions

See All

Make Way for Fat Chicken, from the Maker...
Make Way for Fat Chicken, from the Makers of Scrap Squad Posted by Jessica Fisher on November 26th, 2014 [ permalink ] Relevant Games has announced they will be releasing their reverse tower defense game, | Read more »
Tripnary Review
Tripnary Review By Jennifer Allen on November 26th, 2014 Our Rating: :: TRAVEL BUCKET LISTiPhone App - Designed for the iPhone, compatible with the iPad Want to create a travel bucket list? Tripnary is a fun way to do exactly that... | Read more »
Ossian Studios’ RPG, The Shadow Sun, is...
Ossian Studios’ RPG, The Shadow Sun, is Now Available for $4.99 Posted by Jessica Fisher on November 26th, 2014 [ permalink ] Universal App - Designed for iPhone and iPad | Read more »
Mmmm, Tasty – Having the Angry Birds for...
The very first Angry Birds debuted on iOS back in 2009. When you sit back and tally up the number of Angry Birds games out there and the impact they’ve had on pop culture as a whole, you just need to ask yourself: “How would the birds taste... | Read more »
Rescue Quest Review
Rescue Quest Review By Jennifer Allen on November 26th, 2014 Our Rating: :: PATH BASED MATCH-3Universal App - Designed for iPhone and iPad Guide a wizard to safety by matching gems. Rescue Quest might not be an entirely original... | Read more »
You Can Play the Final Chapter of Lone W...
You Can Play the Final Chapter of Lone Wolf: Dawn Over V’taag Right Now Posted by Jessica Fisher on November 26th, 2014 [ permalink ] Universal App - Designed for iPhone and iPad | Read more »
Swords of Anima (Games)
Swords of Anima 1.0 Device: iOS Universal Category: Games Price: $2.99, Version: 1.0 (iTunes) Description: A new tactical turn-based RPG experience. Command the Savior Rex Squad in an epic journey of courage and deception. Can you... | Read more »
Audio Defence: Zombie Arena
Audio Defence: Zombie Arena By Lee Hamlet on November 26th, 2014 Our Rating: :: DRAGS ITS FEETUniversal App - Designed for iPhone and iPad From the makers of Papa Sangre comes a defense game that forces players to listen carefully... | Read more »
Tales from the Borderland​s Will be Comi...
Tales from the Borderland​s Will be Coming to iOS by the End of the Year Posted by Jessica Fisher on November 26th, 2014 [ permalink ] Telltale Games has announced | Read more »
Sunburn! Review
Sunburn! Review By Campbell Bird on November 26th, 2014 Our Rating: :: DON'T DIE ALONEUniversal App - Designed for iPhone and iPad Platform through the depths of space to make sure your entire crew dies together in this satisfying... | Read more »

Price Scanner via MacPrices.net

2014 1.4GHz Mac mini on sale for $449, save $...
 B&H Photo has the new 1.4GHz Mac mini on sale for $449.99 including free shipping plus NY tax only. Their price is $50 off MSRP, and it’s the lowest price available for this new model. Adorama... Read more
Early Black Friday pricing on 27-inch 5K iMac...
 B&H Photo continues to offer Black Friday sale prices on the 27″ 3.5GHz 5K iMac, in stock today and on sale for $2299 including free shipping plus NY sales tax only. Their price is $200 off MSRP... Read more
Early Black Friday sale prices on iPad Air 2,...
 MacMall is discounting iPad Air 2s by up to $75 off MSRP as part of their Black Friday sale. Shipping is free: - 16GB iPad Air WiFi: $459 $40 off - 64GB iPad Air WiFi: $559 $40 off - 128GB iPad Air... Read more
Early Black Friday MacBook Air sale prices, $...
 MacMall has posted early Black Friday MacBook Air sale prices. Save $101 on all models for a limited time: - 11″ 1.4GHz/128GB MacBook Air: $798 - 11″ 1.4GHz/256GB MacBook Air: $998 - 13″ 1.4GHz/... Read more
Why iPhone 6 Tablet/Laptop Cannibalization Is...
247wallst.com blogger Douglas A. McIntyre noted last week that according to research posted on the Applovin blog site the iPhone 6 is outselling the iPhone 6 Plus by a wide margin . Hardly a surprise... Read more
Worldwide Tablet Growth Expected to Slow to 7...
The global tablet market is expected to record massive deceleration in 2014 with year-over-year growth slowing to 7.2%, down from 52.5% in 2013, according to a new forecast from International Data... Read more
Touchscreen Glove Company Announces New Produ...
Surrey, United Kingdom based TouchAbility specializes in design and manufacture of a wide variety of products compatible with touchscreen devices including smartphones, tablets and computers. Their... Read more
OtterBox Alpha Glass Screen Protectors for iP...
To complement the bigger, sharper displays on the latest Apple devices, OtterBox has introduced Alpha Glass screen protectors to the iPhone 6 and iPhone 6 Plus. The fortified glass screen protectors... Read more
Early Black Friday Mac Pro sale, 6-Core 3.5GH...
 B&H Photo has the 6-Core 3.5GHz Mac Pro on sale today for $3499 including free shipping plus NY sales tax. Their price is $500 off MSRP, and it’s the lowest price available for this model from... Read more
Early Black Friday sale price: 15-inch 2.2GHz...
 B&H Photo has the 2014 15″ 2.2GHz Retina MacBook Pro on sale today for $1699.99. Shipping is free, and B&H charges NY sales tax only. Their price is $300 off MSRP, equalling Best Buy’s price... Read more

Jobs Board

*Apple* Solutions Consultant (ASC) - Apple (...
**Job Summary** The ASC is an Apple employee who serves as an Apple brand ambassador and influencer in a Reseller's store. The ASC's role is to grow Apple Read more
Senior Event Manager, *Apple* Retail Market...
…This senior level position is responsible for leading and imagining the Apple Retail Team's global event strategy. Delivering an overarching brand story; in-store, Read more
*Apple* Retail - Multiple Positions (US) - A...
Sales Specialist - Retail Customer Service and Sales Transform Apple Store visitors into loyal Apple customers. When customers enter the store, you're also the Read more
*Apple* Solutions Consultant (ASC) - Apple (...
**Job Summary** The ASC is an Apple employee who serves as an Apple brand ambassador and influencer in a Reseller's store. The ASC's role is to grow Apple Read more
*Apple* Solutions Consultant (ASC) - Apple (...
**Job Summary** The ASC is an Apple employee who serves as an Apple brand ambassador and influencer in a Reseller's store. The ASC's role is to grow Apple Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.