[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Unix daemons in MacPerl (step two)



> Isn't there another consideration?  MacPerl is not threaded, so even if the
> process is "polite", it will tie up MacPerl while it is running.  I think to
> have more than one MacPerl process, you need to have MacPerl running with a
> different creator code.  I think Chris Nandor wrote a MacPerl cron script a
> while back ... it might be instructive to see what strategy he used to get
> around this limitation.

Yes, I have considered it, and wasn't going to mention it until I 
actually have code in hand to show how it's done.  I suspect there'll be 
a bit of a hack with ResEdit to jimmy a stand-alone runtime (not the full 
MacPerl).  Lack of threading, however, is a now a short-term issue. I 
expect a near future version of MacPerl will do threading and eliminate 
this step.

As yet, however, threading isn't an issue.  Running the process in the 
background can be done without it (with the caveat that it DOES tie up 
MacPerl).  I'm not there yet.

At this point, I'm fairly certain that I *can't* do a completely faceless 
app.  The problem arises from the nature of MacPerl runtimes, which draw 
their own menu bar by default.  A true faceless background app has no 
menubar, doesn't ever call anything that draws to the screen and can not 
accept any events except nullEvent and HighLevelEvent (AppleEvents). 
Something a FBA can do is initialize QuickDraw, but only to create 
off-screen grafPorts, or some other QuickDraw functions, and not to 
actually draw to the screen. These things happen within the MacPerl app 
even if you don't explicitly call them from within Perl.  As a result, a 
tre FBA is out of the question.

I should be able to hide the menubar, and perform similar half-measures 
to approximate such behavior, but what's really needed here is a 
different (even more minimal) wrapper for the runtime interpreter.  I'm 
neither willing nor able to provide such, and I doubt there'll be any 
volunteers.

I seem to recall a discussion of cron utilities for the Mac a while back, 
but have no clear recollection of Chris having written a Perl script.  
That would be helpful.

--B

Aside:  It seems possible to do a FBA in AppleScript, and have it CALL 
MacPerl to do the front-end business.  It's a bit of a hack.  You write 
the AppleScript, compile it, then edit the resource fork to change the 
type from APPL to appe and set modeOnlyBackground in the SIZE-1 resource 
to true.  Most definitely not for the faint-hearted!

Brian McNett, Webmaster
*************************************************************
Mycoinfo. The world's first mycology e-journal.
http://www.mycoinfo.com/
*************************************************************


# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org