Firstly the disclaimer, this advice comes with no understanding of the
FM API, but rather general OS X programming (well, Cocoa
specifically). It would probably be worth trying to find out if the FM
API is thread safe or not, someone else on this list might be able to
comment on that.
If you're using NSNotification I'm guessing you're writing the daemon
using objective-c and Cocoa, so I'd suggest you look at creating
another thread (using NSThread) and do your processing in there.
Assuming you're not going to be receiving these notifications with a
high frequency (e.g. consistently high numbers per second) the cost of
creating and tearing down an NSThread instance for each NSNotification
you receive shouldn't be too high. If not creating a pool of worker
threads would be more efficient (but a lot more work as well).
Hope this helps.
--
Hayden
On Oct 26, 2009, at 11:32 , Marcus Wood wrote:
>
> Hi there,
>
> I am developing a plugin for mac os x that needs a 'daemon' style
> process in
> the background that can access the FM API
> It would wait for notifications broadcast from another application (an
> NSNotification) and act on them by updating a table
>
> If I fork() then it forks the whole FM process and if I start a
> separate
> executable then it wont be able to access the FM API
>
> Has anyone had any experience with anything like this or could point
> me in
> the right direction?
>
> Thanks :)
> Marcus
> --
> View this message in context:
http://www.nabble.com/Daemon-Processes-tp26050389p26050389.html> Sent from the Filemaker plug-in - Dev mailing list archive at
> Nabble.com.
>
>
>
#!/usr/bin/perl
chop($_=<>);@s=split/ /;foreach$m(@s){if($m=='*'){$z=pop@t;$x=
pop@t;$a=eval"$x$m$z";push@t,$a;}else{push@t,$m;}}print"$a\n";
#
http://voo-du.net/------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/fmplug-prog-list/<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/fmplug-prog-list/join (Yahoo! ID required)
<*> To change settings via email:
mailto:
[hidden email]
mailto:
[hidden email]
<*> To unsubscribe from this group, send an email to:
[hidden email]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/