Re: AppleScript's Threadedness…
Re: AppleScript's Threadedness…
- Subject: Re: AppleScript's Threadedness…
- From: has <email@hidden>
- Date: Thu, 11 Dec 2008 19:57:07 +0000
On 11 Dec 2008, at 06:35, Chris Page wrote:
Idle curiousity, but I've occasionally wondered if it'd be possible
to use AS on a single background thread if you install your own
send proc (to receive Apple events via a dedicated mach port). Or
does the interpreter have other dependencies on the main thread as
well?
Just to satisfy your curiosity: If you're very, very careful, you
may be able to get away with it for a while. But don't do it,
because it's not guaranteed to work and may break in the future. [...]
Cheers for the info; it's not something I've a need for myself, but I
occasionally see the question come up elsewhere and was curious what
the answer would be. "Use separate processes" would seem to be the
best response.
One more question, if I may, although it's only tangentially related
to the last one...
Let's say I'm writing an OSA component [1] for a language whose
interpreter needs to be hosted in a separate process from the process
that's loaded the OSA component itself, e.g. because the interpreter
doesn't provide adequate insulation between unrelated scripts. What
would be the best IPC mechanism to tie the OSA component to the
interpreter process(es), bearing in mind that they need full two-way
communication (e.g. the component needs to tell the interpreter to
compile a script or call its handlers; the interpreter needs to
dispatch Apple events via the component's sendProc), and good
performance remains important despite all the crossing of process
boundaries?
Thanks,
has
[1] I've already abandoned two attempts at implementing an in-process
Python component and would happily award a million internets to anyone
that can create a modern, flexible CFBundle-based replacement to the
existing OSA architecture, which is a complete pain to use. But until
that happens (or I give up waiting and write the thing myself) I would
like to give the OSA approach one more go, if only for sake of
providing compatibility with existing attachable applications such as
Mail and System Events.
--
Control AppleScriptable applications from Python, Ruby and ObjC:
http://appscript.sourceforge.net
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden