Professional Web Applications Themes

Multiprocessing.h issue - Mac Programming

I am new to Mac programming and its programming environment. I am trying to compile a sample app as described in Apples doent "Adding Multitasking Capability to Applications Using Multiprocessing Services". This doent discusses, with the help of code fragments how to create tasks. I am using ProjectBuilder to create this sample app. However, the compiler complains that it can't find Multiprocessing.h". I have added CoreFoundation framework in the project (because I do some stuff with serial ports and it requires that). I have tried adding CoreServices framweork but it hasn't helped. I have not yet fully mastered this programming ...

  1. #1

    Default Multiprocessing.h issue

    I am new to Mac programming and its programming environment. I am trying
    to compile a sample app as described in Apples doent "Adding
    Multitasking Capability to Applications Using Multiprocessing Services".
    This doent discusses, with the help of code fragments how to create
    tasks.

    I am using ProjectBuilder to create this sample app. However, the
    compiler complains that it can't find Multiprocessing.h". I have added
    CoreFoundation framework in the project (because I do some stuff with
    serial ports and it requires that). I have tried adding CoreServices
    framweork but it hasn't helped.

    I have not yet fully mastered this programming environment. I will
    appreciate if someone can point out how I can make compiler find
    Multiprocessing.h.

    Thanks
    ===================

    Asd Guest

  2. #2

    Default Re: Multiprocessing.h issue

    In article <7OFfb.497576$cF.175954rwcrnsc53>, Asd <edu> wrote:
     

    Sounds like the doent you're reading was written for Mac OS 9, not
    Mac OS X. On Mac OS X, instead of
    #include <Multiprocessing.h>
    you'd write this:
    #include <CoreServices/CoreServices.h>
    and make sure that you've included the CoreServices framework (as you've
    already done).

    Hope this helps,
    Eric

    --
    Eric Albert edu
    http://rescomp.stanford.edu/~ejalbert/
    Eric Guest

  3. #3

    Default Re: Multiprocessing.h issue

    Eric Albert wrote:
     
    >
    >
    > Sounds like the doent you're reading was written for Mac OS 9, not
    > Mac OS X. On Mac OS X, instead of
    > #include <Multiprocessing.h>
    > you'd write this:
    > #include <CoreServices/CoreServices.h>
    > and make sure that you've included the CoreServices framework (as you've
    > already done).
    >
    > Hope this helps,
    > Eric
    >[/ref]

    Thanks, Eric.

    Asd Guest

  4. #4

    Default Re: Multiprocessing.h issue

    Asd wrote: 
    >>
    >>
    >>
    >> Sounds like the doent you're reading was written for Mac OS 9, not
    >> Mac OS X. On Mac OS X, instead of
    >> #include <Multiprocessing.h>
    >> you'd write this:
    >> #include <CoreServices/CoreServices.h>
    >> and make sure that you've included the CoreServices framework (as
    >> you've already done).
    >>
    >> Hope this helps,
    >> Eric
    >>[/ref]
    >
    > Thanks, Eric.
    >[/ref]

    It seems that doent does discuss Mac OS X seperately from Mac OS 9.
    But could be that code fragments havent been updated.

    I have now another issue with OSError and OSStatus data type. I can't
    figure out which header file defines these symbols. I am looking at
    Carbon doentation for MPCreateTask() nbut is of no help in
    determining which header file needs to be included., I will appreciate
    any help.

    Thanks.

    =====================


    Asd Guest

  5. #5

    Default Re: Multiprocessing.h issue

    dans l'article 7OFfb.497576$cF.175954rwcrnsc53, Asd à edu a écrit
    le 4/10/03 22:09:
     

    If your app is targeted for MacOSX, I strongly recommend that you switch to
    NSThreads (if using Cocoa) or pthreads. MPServices is a MacOS9 technology
    which is now deprecated.

    Eric

    Eric Guest

  6. #6

    Default Re: Multiprocessing.h issue

    In article <54Qfb.42145$%h1.28506sccrnsc02>, Asd <edu> wrote:
     

    CoreServices/MacTypes.h

    hth

    meeroh

    --
    If this message helped you, consider buying an item
    from my wish list: <http://web.meeroh.org/wishlist>

    Miro Guest

  7. #7

    Default Re: Multiprocessing.h issue

    Eric VERGNAUD wrote: 
    >
    >
    > If your app is targeted for MacOSX, I strongly recommend that you switch to
    > NSThreads (if using Cocoa) or pthreads. MPServices is a MacOS9 technology
    > which is now deprecated.
    >
    > Eric
    >[/ref]
    Thanks again, Eric.


    I read the technote at
    http://developer.apple.com/technotes/tn/tn2028.html which doesn't
    clearly mention that MPServices is deprecated. It does mention though
    that it is available in both, OS 9 and OS X. And thst it is layered on
    top of pthreads, just as NSThread is.

    Anyways, I am targetting only OS X and I have seen Cocoa samples using
    NSThreads. Can you recommend me to any pthread sample or doentation
    that can help me here? Basically what I am trying to accomplish is: once
    my object is instantiated, it should continually do certain i/o
    through serial device, and then provide certain information back to
    caller when it calls certain method on it. The task that needs to run
    continuously is implemented, what is missing is to sort of detach it and
    make it run like a thread.

    Thanks!

    ===========================

    Asd Guest

  8. #8

    Default Re: Multiprocessing.h issue

    Miro Jurisic wrote:
     
    >
    >
    > CoreServices/MacTypes.h
    >
    > hth
    >
    > meeroh
    >[/ref]
    Thanks, Miro.

    ================

    Asd Guest

  9. #9

    Default Re: Multiprocessing.h issue

    > Thanks again, Eric. 

    I have never used pthreads directly. If your thread is going to do some UI,
    you MUST use NSThreads. Also, if your thread is going to exchange some
    messages with the main thread (and not only send notifictaions to it), this
    means the detached thread needs to be able to listen to some messages posted
    by the main thread. So you need to enter an event loop, which is better done
    using NSThreads.

    Eric

    Eric Guest

  10. #10

    Default Re: Multiprocessing.h issue

    In article <BBA5C753.137DD%fr>,
    Eric VERGNAUD <fr> wrote:
     

    That's news to me. MPServices should work fine on Mac OS X.

    -Eric

    --
    Eric Albert edu
    http://rescomp.stanford.edu/~ejalbert/
    Eric Guest

  11. #11

    Default Re: Multiprocessing.h issue

    In article <BBA62E71.137FD%fr>,
    Eric VERGNAUD <fr> wrote:
     

    Apple's doentation for OpenGL contradicts that. It says that all
    Macintosh OpenGL renderers are multi-processor safe. I've had no trouble
    doing OpenGL from an MP thread on 9 or X.

    Am I missing something?
    David Guest

  12. #12

    Default Re: Multiprocessing.h issue

    In article <sf.sbcglobal.net>,
    David Phillip Oster <org> wrote:
     
    >
    > Apple's doentation for OpenGL contradicts that. It says that all
    > Macintosh OpenGL renderers are multi-processor safe. I've had no trouble
    > doing OpenGL from an MP thread on 9 or X.
    >
    > Am I missing something?[/ref]

    Nope. More and more Mac OS X APIs are thread-safe. Most of AppKit (but
    not all) is, as is all of Core Graphics and OpenGL. Carbon's UI APIs
    are still limited to the main thread, though.

    -Eric

    --
    Eric Albert edu
    http://rescomp.stanford.edu/~ejalbert/
    Eric Guest

  13. #13

    Default Re: Multiprocessing.h issue

    Eric Albert wrote: 
    >
    >
    > That's news to me. MPServices should work fine on Mac OS X.
    >
    > -Eric
    >[/ref]
    I agree with you. The apple Technote that I mentioned in my earlier post
    mentions that MPServices are available in OS X.

    Can someone point me to a working sample ProjectBuilder app that shows
    how to do it though. I have code fragments that shows how to do it. But
    due to total inexperience with Mac programmin environment, I run into
    problems such as header files, and framework to include etc.

    ===============

    Asd Guest

  14. #14

    Default Re: Multiprocessing.h issue

    In article <EH3gb.225031$ops.asp.att.net>,
    Asd <edu> wrote:
     
    > >
    > >
    > > That's news to me. MPServices should work fine on Mac OS X.[/ref][/ref]
     

    You've already got the header and framework. Just include the
    CoreServices framework and #include <CoreServices/CoreServices.h>
    everywhere. If that doesn't work, you're probably including Carbon
    APIs. For that, add the Carbon framework and #include <Carbon/Carbon.h>.

    -Eric

    --
    Eric Albert edu
    http://rescomp.stanford.edu/~ejalbert/
    Eric Guest

  15. #15

    Default Re: Multiprocessing.h issue

    dans l'article sf.sbcglobal.net, David
    Phillip Oster à org a écrit le 6/10/03 0:59:
     
    >
    > Apple's doentation for OpenGL contradicts that. It says that all
    > Macintosh OpenGL renderers are multi-processor safe. I've had no trouble
    > doing OpenGL from an MP thread on 9 or X.
    >
    > Am I missing something?[/ref]

    I was thinking about Cocoa UI not OpenGL.

    Eric Guest

Similar Threads

  1. CF 4.5 issue
    By nakedbob in forum Coldfusion Server Administration
    Replies: 0
    Last Post: August 5th, 04:13 PM
  2. Url Issue
    By Yunus Emre ALPÖZEN [MCAD.NET] in forum ASP.NET Security
    Replies: 0
    Last Post: May 15th, 02:35 PM
  3. [PHP] non-php issue
    By Mek2600-Php in forum PHP Development
    Replies: 12
    Last Post: September 22nd, 03:28 PM
  4. non-php issue
    By Wang Feng in forum PHP Development
    Replies: 1
    Last Post: September 22nd, 04:07 AM
  5. 4GL V7.32 issue
    By Malc P in forum Informix
    Replies: 1
    Last Post: August 26th, 09:02 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