Professional Web Applications Themes

Shared memory in OS X? - Mac Programming

I am porting an app from Classic to OS X...and the biggest problem I've run into is how to get live notification of changes to prefs. The app consists of a "daemon" and a preference-setter. The daemon is Mach-O, the preference-setter is written in Carbon. Right now, I just have the daemon continuously polling a file, which is not the best way to do it. Is there anyway for a Carbon app to instantly communicate with a Mach-O app? I'd prefer to avoid AppleEvents... Thanks! Mike Hunson...

  1. #1

    Default Shared memory in OS X?

    I am porting an app from Classic to OS X...and the biggest problem I've run
    into is how to get live notification of changes to prefs.

    The app consists of a "daemon" and a preference-setter. The daemon is
    Mach-O, the preference-setter is written in Carbon.

    Right now, I just have the daemon continuously polling a file, which is not
    the best way to do it. Is there anyway for a Carbon app to instantly
    communicate with a Mach-O app? I'd prefer to avoid AppleEvents...

    Thanks!

    Mike Hunson

    Mike H. Guest

  2. #2

    Default Re: Shared memory in OS X?

    On Mon, 29 Sep 2003, Mike H. wrote:
    > I am porting an app from Classic to OS X...and the biggest problem I've run
    > into is how to get live notification of changes to prefs.
    >
    > The app consists of a "daemon" and a preference-setter. The daemon is
    > Mach-O, the preference-setter is written in Carbon.
    >
    > Right now, I just have the daemon continuously
    >polling a file, which is not
    > the best way to do it. Is there anyway for a Carbon app to instantly
    > communicate with a Mach-O app? I'd prefer to avoid AppleEvents...
    For actual shared memory, there's always shmctl and friends, but for what
    you are trying to do CFMessagePort is probably more appropriate
    Or you could just send the daemon a signal telling it to reread its
    configuration file
    Why are you so hesitant to use apple events?

    Fred
    >
    > Thanks!
    >
    > Mike Hunson
    >
    >
    Frederick Cheung Guest

  3. #3

    Default Re: Shared memory in OS X?

    Mike H. <nospamendspam.org> wrote:
    > I am porting an app from Classic to OS X...and the biggest problem I've run
    > into is how to get live notification of changes to prefs.
    >
    > The app consists of a "daemon" and a preference-setter. The daemon is
    > Mach-O, the preference-setter is written in Carbon.
    >
    > Right now, I just have the daemon continuously polling a file, which is not
    > the best way to do it. Is there anyway for a Carbon app to instantly
    > communicate with a Mach-O app? I'd prefer to avoid AppleEvents...
    Have a look-see: <http://makeashorterlink.com/?F5A413C06>

    Your best bet looks to be a Core Foundation distributed notification. A
    less Apple-oriented solution would be pipes or sockets, but those would
    still require polling the filesystem.
    Paul Mitchum Guest

  4. #4

    Default Re: Shared memory in OS X?

    In article <1g21w8l.16i6e0qzjuo6hN%usenetmile23.com.r3m0v3 >,
    [email]usenetmile23.com[/email].r3m0v3 (Paul Mitchum) wrote:
    > Mike H. <nospamendspam.org> wrote:
    >
    > > I am porting an app from Classic to OS X...and the biggest problem I've run
    > > into is how to get live notification of changes to prefs.
    > >
    > > The app consists of a "daemon" and a preference-setter. The daemon is
    > > Mach-O, the preference-setter is written in Carbon.
    > >
    > > Right now, I just have the daemon continuously polling a file, which is not
    > > the best way to do it. Is there anyway for a Carbon app to instantly
    > > communicate with a Mach-O app? I'd prefer to avoid AppleEvents...
    >
    > Have a look-see: <http://makeashorterlink.com/?F5A413C06>
    >
    > Your best bet looks to be a Core Foundation distributed notification. A
    > less Apple-oriented solution would be pipes or sockets, but those would
    > still require polling the filesystem.
    I'll second Paul's suggestion. CFNotifications are the standard way to
    do this.

    -Eric

    --
    Eric Albert [email]ejalbertstanford.edu[/email]
    [url]http://rescomp.stanford.edu/~ejalbert/[/url]
    Eric Albert Guest

Similar Threads

  1. Shared memory and Mac OS X
    By Wes in forum PostgreSQL / PGSQL
    Replies: 5
    Last Post: February 22nd, 04:01 AM
  2. Shared Memory/Shared Buffers
    By Alex Turner in forum PostgreSQL / PGSQL
    Replies: 1
    Last Post: January 28th, 04:09 PM
  3. Postgres not using shared memory
    By Karl O. Pinc in forum PostgreSQL / PGSQL
    Replies: 4
    Last Post: December 16th, 06:48 PM
  4. extended shared memory
    By aixtest in forum AIX
    Replies: 3
    Last Post: August 22nd, 03:16 AM
  5. I think I need a DB with no shared memory
    By dimonex in forum Informix
    Replies: 1
    Last Post: July 3rd, 05:20 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139