General question regarding "parallelism" of iPhone execution

I've got a general question and hope somebody can shed some light on this.
While I'm relatively new to iPhone development I've been in software programing for more than 15 years now and have a solid background in Java, C, C++, C# and other languages. I've created a couple of applications for the iPhone, easy and complex ones, some using UIKit, others using Open GL and Open AL. With that said I think it would be fair to say that I know pretty much what I'm talking about.
For those who tend to refer everybody back to the Apple Samples or PDF guides, please believe me, I've read them all.
Here's my "question":
I occasionally ran into a situation where I got the impression that code on the iPhone got executed in a "non sequential" or "parallel" manner even when I did not explicitly created threads. I'm not referring to code buried in a framework or so, I'm talking about code I've written. (English is not my mother tongue, so please excuse me if my explanation might be somewhat difficult to understand.)
I try to give an example. Assume a code snippet like this:
_gameEngine = [GameEngine alloc];
[_gameEngine initSomeStuff];
In my understanding the second statement (the initSomeStuff) gets executed once alloc returns and _gameEngine for sure is a valid pointer. Is that fair to say? I sometimes got the impression that the iPhone starts executing code without waiting that a method returned.
I had similar issues when I tried to show an ActivityIndicator while another method was doing a lengthy operation. Pseudocode like this:
[_activityIndicator show];
[self longLastingOperation];
[_activityIndicator hide];
In code like the one above: Can I be 100% sure, that the hide message is not sent until longLastingOperation returns? I ran into a situation where I had the impression that show and hide got called immediately without waiting until longLastingOperation returned.
Final example:
[self performSelectorOnMainThread:@selector(doSomething) withObject:nil waitUntilDone:YES];
[self nextStatement];
-(void)doSomething {
[self longLastingOperation];
1.) In the above code, I understand the idea is that doSomething will be executed on the MainThread and that nextStatement will in no way be executed before doSomething has returned. Is that true?
2.) doSomething is supposed to run on the MainThread but does this hold true for longLastingOperation, too? Or could it be that longLastingOperation WITHIN doSomething gets dispatched to another thread and doSomething returns PRIOR to longLastingOperation been finished?
This might all sound pretty wired but as I said from time to time I ran into a situation where I got totally confused as to how stuff executes in – or out of – sequence. I helped myself with using NSNotificationCenters etc. but I'd like to understand what's going on in detail and crystal clear here.
Your help is more than appreciated.
Thanks,
R.
Message was edited by: BeSharp

It is never safe to assume that any allocation was successful, and while it's incredibly unlikely that you're running into any such situation, it's entirely possible for a formal protocol to declare that a given message send should return immediately without waiting around:
http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Articles/ch apter13_section_8.html#//appleref/doc/uid/TP30001163-CH9-BAJIGHAF
An "impression" doesn't prove much unfortunately, so I'd recommend getting friendly with the debugger to see what's really going on.

Similar Messages

  • Question Regarding "Find My iPhone" App (Used On Macbook Pro)

    Here's what I lost:
    - iPod Touch 8BG (I got the iPod in August of 2009)
    - The iPod SHOULD be in my house.
    Here's what I'm trying to find my iPod with:
    - "Find My iPhone" App on iTunes
    - MacBook Pro (Mac OS X Version 10.5.8) My laptop was also purchased in August of 2009, and my software is up to date.
    Here's my main question: Is it possible to use the "Find My iPhone" App on my computer to help me find my missing iPod if I DO NOT have the "Find My iPhone" App on my iPod? I would assume that the answer to my question would be "no", but I'm not very familiar with apps.

    You need to pay to update the OSX on your Mac.
    Mountain Lion (OSX 10.7.x) requires
    General Requirements
    OS X v10.6.8 or later
    2GB of memory
    8GB of available space
    Some features require an Apple ID; terms apply.
    Some features require a compatible Internet service provider; fees may apply.
    Supported Models
    iMac (Mid 2007 or newer)
    MacBook (Late 2008 Aluminum, or Early 2009 or newer)
    MacBook Pro (Mid/Late 2007 or newer)
    Xserve (Early 2009)
    MacBook Air (Late 2008 or newer)
    Mac mini (Early 2009 or newer)
    Mac Pro (Early 2008 or newer)
    Also since you said you have iPod Touch 8BG (I got the iPod in August of 2009), that iPod is a 2G iPod touch that does not Support iCloud. However, if you previously subscribed to the paid MobileMe you might be able to find it but since you can;t log into iCloud you can't do that.
    Sorry but you are out of luck finding your 2G iPod except the old fashioned way, lokk for it,.

  • A few questions regarding my new iPhone

    A few questions:
    1. I notice that if I am browsing a second page on my browser for about a minute and then navigate back to my first page... it's "blanked out" and am forced to refresh. Is this normal? Any way around this? Not particularly useful when on Meebo or when I'm trying to compare movie time on two different movie theatres.
    2. Is there any way to save images from a site or from an email to my phone? I know I can't receive MMS so I thought I'd email me a picture to add it to my contacts and couldn't find a way. I also browsed online for an image and couldn't save it nor add it to a contact either. Any way to do this? I had to wait to get home and sync the images to my phone.
    3. I noticed that the iPhone's connector is the same as my iPod's connector, but if I plug it into my iPod's dock, a warning comes up that warns me it's not designed for the iPhone. Will I harm my iPhone if I plug it into my car charger, wall charger, dock that's AVed into my TV? I'm just really worried that it'll screw my phone up.
    4. I read somehwere I can open PDF's on my iPhone. Can I save a PDF to my phone and open it somehow?
    Thanks!!

    1. I notice that if I am browsing a second page on my browser for about a minute and then navigate back to my first page... it's "blanked out" and am forced to refresh. Is this normal? Any way around this? Not particularly useful when on Meebo or when I'm trying to compare movie time on two different movie theatres.
    This is normal - in my experience anyway but not with all websites. It doesn't do the same when I have one page open on these discussions, navigate to another page and then back, the discussions page I had opened is not refreshed.
    2. Is there any way to save images from a site or from an email to my phone? I know I can't receive MMS so I thought I'd email me a picture to add it to my contacts and couldn't find a way. I also browsed online for an image and couldn't save it nor add it to a contact either. Any way to do this? I had to wait to get home and sync the images to my phone.
    Not supported from a website or from a received messages. You must do as provided with your last sentence - at the present time anyway.
    3. I noticed that the iPhone's connector is the same as my iPod's connector, but if I plug it into my iPod's dock, a warning comes up that warns me it's not designed for the iPhone. Will I harm my iPhone if I plug it into my car charger, wall charger, dock that's AVed into my TV? I'm just really worried that it'll screw my phone up.
    If you get this warning you shouldn't ignore it. Even though the connection type might be the same, if the device is not compatible with the iPhone it can cause problems or potential damage. There are auto chargers that specifically indicated - made for or compatible with the iPhone. I purchased a car charger that is compatible with my iPhone and with my iPod with video.
    You can alway check with the manufacturer of the device to determine if the device is also compatible with the iPhone regardless the warning but this should be in writing via their website or provided via email.
    4. I read somehwere I can open PDF's on my iPhone. Can I save a PDF to my phone and open it somehow?
    You can view PDF, Word and Excel documents attached to a received email from within the received message but you can't save the attachments outside of the message.

  • General question regarding environment files in APPL_TOP

    Hi. I will be passing my OCP (hopefully) next month and I am now turning my head to teh Applications side since my job involves a lot of Oracle Financials.
    I just did a clean installation of 11.5.10.2 but at the level of seeting environment files, my boss swooped in and did them all. I would love to know which ones need changing, or even which ones do what ...
    I am using the Oracle doc Re: Generate the Database Context File
    to follow with, but what I see before me in our own (9i, AIX 5.2) set up doesnt always mirror what the doc says.
    I need some general information about these env. files. In our <ORA>APPL directory we have the following env. files:
    APPSORA.env
    DEV.env
    DEV_davidcl.env
    APPSDEV_davidcl.env
    DAVIDCUST.env (I have changed our firm's name to David)
    In the doc, it explains that there is a "main applications env file", and a consolidated applications file". <CONTEXT_NAME>.env and APPS<CONTEXT_NAME>.env respectively. Which ones are those in my directory listing?
    I have also checked in the .profile of the appcldev and the appdbdev users, and they both point to the same two environment files -
    $APPL_TOP/DAVIDCUST.env
    and
    $APPL_TOP/APPSORA.env
    Sorry this is a bit scrambled message - is there any other source out there to explain environment files?
    Thanks
    DA

    Thanks - they are the same! That's why the DEV_davidcl.env has all the parameters that according to the doc APPDDEV_davidcl.env should have.
    Thanks - very helpful. The DBA here never has any time to explain this stuff, since I think he's been doing it for so long that he doenst understand why anyone would not know it too. Its very hard working for him sometimes since nothing is explained.
    All of my questions are stemming from this clean installation of 11.5.2 that I have done.
    I am still wondering about the .profiles of each user we have on the system though. I understand that we had to copy the profiles from TEST to this, our DEV side, then we edited the profiles to match the DEV parameters. Fine.....but the actual .env files themselves - I am looking at them and dont understand at all.
    Each .profile and each user are as follows:
    appdbdev:
    appdbdev@TEST:more .profile
    APPL_TOP=/oradbi3/oracle/testappl;export APPL_TOP
    . $APPL_TOP/DAVIDCUST.env
    . $APPL_TOP/APPSORA.env
    appcldev:
    appcldev@TEST:more .profile
    APPL_TOP=/oracli3/oracle/devappl;export APPL_TOP
    . $APPL_TOP/DAVIDCUST.env
    . $APPL_TOP/APPSORA.env
    So these two, both on the cl node, appear to be pointing to same env files.
    Then comes the db node:
    oradbdev:
    oradbdev@TEST:more .profile
    . /oradbi3/oracle/devdb/9.2.0/DEV_daviddb.env
    . /oradbi3/oracle/devappl/DAVIDCUST.env
    I think I can understand the .env that are pointed to on the cl node, but I dont understand the oradbdev .profile, since its pointing to oradbi3/oracledevdb for one env file, then oradbi3/oracle/devappl for another.
    I asked our DBA about this, and he said "dont worry about it". I have to try and run the script to start the application server this morning, but every time I try to su to the db node user I get this:
    doralcl:/> su - appdbdev
    .profile[2]: /oradbi3/oracle/devappl/DAVIDCUST.env: not found.
    Like I mentioned, I pinted this out to our DBA and he told me not to worry.
    DA

  • General Question Regarding Image Processing

    Hi All,
    I need a suggestion regarding image processing and this is the best place to get best advise.
    we need an image processing utility for our web processing.
    requirements are as described below:
    we have a e commerce based application where we need to display product images which we are currently displaying successfully.
    now we have to provide user with image processing functionality like user can zoom image can flip image can rotate image.
    what we want like when user click on zoom we can generate a dynamic image of that region based on a single source of image and can provide zooming functionality.
    more over company requirements is to go for only open source solution [:-)]
    we tried some open source solutions but due to the in house E-Commerce framework constraints we not able to integrate them,.
    can any one point me to any open source java based library so that we can use that to provide solution or do we need some other approach.
    Here is a link for a image zooming example hough this is highly professional solution using Adobe Scene7 but we want to implement something like in image zooming
    [Zoom Demo|http://s7d2.scene7.com/s7ondemand/zoom/flasht_zoom.jsp?company=S7Web&sku=AnthroISwebDemo&config=S7Web/AnthroISwebDemo&zoomwidth=500&zoomheight=500&viewer=/skins/S7Web/SWFs/loaders/genericzoomLfour.swf&vc=codeRoot%3D%2Fis-viewers351%2Fflash%2F]
    any help in this regard will be much appreciated.
    Thanks in advance
    -Umesh

    It is never safe to assume that any allocation was successful, and while it's incredibly unlikely that you're running into any such situation, it's entirely possible for a formal protocol to declare that a given message send should return immediately without waiting around:
    http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Articles/ch apter13_section_8.html#//appleref/doc/uid/TP30001163-CH9-BAJIGHAF
    An "impression" doesn't prove much unfortunately, so I'd recommend getting friendly with the debugger to see what's really going on.

  • General questions regarding capturing electronic signatures

    Hi Guys,
    Have some questions....
    Are electronic signatures supported in BPM and if yes any idea what types of signature? what standards are used, whether they are legally accepted and whether this is part of the package or a separate application. 
    can the processes support multiple signatures at multiple stages, signifying different levels of approval?
    Could you provide some idea on how electronic signatures are recorded and retained and how the process or document remains fixed once signed?
    Thanks in advace.

    this is more application related. nothing to do with BPM.

  • Questions regarding going from iPhone 3G to iPhone 3G s

    I have the iPhone 3G, and want to get the iPhone 3G s.
    I have had my (AT&T) phone contract since 12-30-08. So, it hasn't been a year yet.
    If I were to go to the store and purchase the iPhone 3Gs (32 GB), could I simply pop-out my SIM card, put it in the iPhone 3Gs and start using it?
    If so, how much would it cost?
    Also, could I give my old iPhone to my little brother, and could he get a new SIM card and start using it?

    Your SMS messages will not transfer to a new phone. Also, make sure you have gotten all of the pictures off of your phone that you've taken with it as those won't transfer, either.
    I have read that MarkSpace has a program that will download your text messages, but have not tried it out myself.

  • General question re: calendar on iphone

    what is the difference between the outlook calendar and the home calendar on my iphone. i don't know which calendar to schedule. i've lost calendar info on this phone from syncing and i don't want this to happen again. thanks!

    It is designed to sync both ways. Any change made on either should be reflected on the other. Take a look at the manual and see if you have it set up properly.
    http://manuals.info.apple.com/enUS/iPhone_UserGuide.pdf

  • General question regarding Nike+Ipod

    I just received my first Ipod and it is a new 5th generation ipod nano.
    Not knowing anything about an Ipod, realized there is a pedometer feature which seems pretty cool and did more reading and if you have this Nike+ program, you can track your workouts, and the main reason for getting the Ipod is to have something to listen to for my workouts.
    I will never get a nike shoe to use this with, so my question: Is it worth getting if I can't put the device inside my shoe or are there other programs that work similar that you can download and purchase for the Ipod??
    Thanks!

    If I'm not mistaken, I think the pedometer works with out the nike+ sensor. Just make sure that you calibrated first. Hope this helps.

  • General Question regarding File Conversion

    Does flash pro provide the ability to convert video
    files,such as avi, mpeg, etc to flash video? Thanks for the
    help.

    yes
    Dan Mode
    *THE online Radio*
    http://www.tornadostream.com
    *Must Read*
    http://www.smithmediafusion.com/blog
    *Flash Helps*
    http://www.smithmediafusion.com/blog/?cat=11
    "Joe Pau" <[email protected]> wrote in
    message
    news:e94jeq$o0$[email protected]..
    > Does flash pro provide the ability to convert video
    files,such as avi,
    > mpeg, etc to flash video? Thanks for the help.

  • General question  regarding NWDI!

    Hi experts,
    I'm using NWDI since two months as a developer and as a post-installer.
    According to your experiences, I would like to know when should we have to use NWDI ? With how many developers ? In which condition do we need NWDI ?
    Thanks for your answers.
    Regards

    Hello Berthe,
      You would use NWDI if you have the following conditions.
      1. You need to customize some sap delivered functions like ESS/MSS. NWDI becomes your build and transport environment in this case.
      2. The number of developers can range from 2 to n.
      3. You need to be able to have versioning and release cycles of the product you are developing
    Hope that helps
    Abdul

  • General question regarding problems

    Is it possible that most of the problems that people are having with the 5th is going to be eventually corrected with updated software?

    Many of the problems people are having can be divided into these areas:
    1. Poor Manual that ships with the IPOD. Most don't read the IPOD 101 before getting frustrated.
    2. Computer and Operating system is a mess before they load ITunes and connect IPOD.
    3. Bad manufactuered IPODs that have problems.
    4. Folks load corrupted files from P2P networks that further hang problems during transfer and play.
    5. Video files that are converted wrong that cause stuttering and audio/video snyc issues.
    6. Improperly disconnecting IPODs from Windows based PCs that cause the IPOD to lock up frequently.
    I could go on and on.
    Firmware could improve some things and maybe smooth a few areas out, but the majority of problems can be directly traced to the above.

  • General question regarding System.out.println

    Just for my knowledge fellas,
    When you have a few System.out.println's in your code, what happens to the lines written to standard out when you run your application from the executable jar file? I know if you run your app in cmd prompt, then the lines are outputted to the cmd screen, and in Netbeans, in the output section...but where do those lines go when you run the app as an executeable? Are they still written, but there's nothing to show the written lines?
    Thanks.
    ...DJVege...

    Just for my knowledge fellas,
    When you have a few System.out.println's in your
    code, what happens to the lines written to standard
    out when you run your application from the executable
    jar file?They get written to standard out, usually the console... doesn't matter at all if it's a JAR or not.
    I know if you run your app in cmd prompt,
    then the lines are outputted to the cmd screen, and
    in Netbeans, in the output section...but where do
    those lines go when you run the app as an
    executeable?cmd screen. Or Java console if you run javaw.

  • General Questions regarding Unity 7.x Architecture

    I am a seeking high-level information about how a decision to prevent a Unity 7.x system from delivering WAV files to users' OSTs/main Exchange email mailboxes would impact hardware requirements and server administration burdens if a company is using Exchange Server 2007.
    I would appreciate any suggestions on where to find prior discussions that address this issue, or other online resources.
    Thanks in advance for any assistance that you can offer, and my apologies in advance for lack of more technical language in this post.

    You can install Exchange on any of them, obviusly the recommendation is the secondary.
    Read this:
    Requirements for Cisco Unity Failover
    http://www.cisco.com/en/US/docs/voice_ip_comm/unity/7x/requirements/7xcusysreq.html#wp472908
    Installation Guide for Cisco Unity Release 5.x in a Unified Messaging Configuration with Microsoft Exchange (With Failover Configured)
    http://www.cisco.com/en/US/docs/voice_ip_comm/unity/5x/installation/guide/umexfo/5xcuigumefox.html
    HTH
    java
    If this helps, please rate
    www.cisco.com/go/pdihelpdesk

  • SAP GRC Process Control - General Questions

    Hi all,
    We have the following general questions regarding SAP GRC Process Control:
    1) Assume that we have set up 5 different SAP Connectors in Process Control. When you configured a specific rule and control and then, schedule the job for such control, how does the system (SAP Process Control) knows which back-end system needs to be accesed for such control?
    2) In which language are the out-of-the box rule steps's script coded? In which different languages can those scripts be coded, what is to say, in which language can we code our own scripts?
    3) How is the detailed flow between SAP Process Control and SAP Back-end system?
    Many thanks. Regards,
        Imanol

    null

Maybe you are looking for

  • Mini-DVI out problem

    I recieved my mini-dvi -> dvi apple adaptor from ebay this morning (finally!), but am having a feew teething problems. The plug fits snugly in the back of the iMac, but if pressure( only a little) is applied to the side or top of the plug (the one go

  • Windows 8 using IE 11 not displaying Web pages

    Certain Web Pages will not display correctly in IE. When I go to the page I see weird code that makes no since. This only happens on certain pages. Others are able to bring up the pages and view the content so I think there is something wrong with my

  • XML validation fails

    Hello, We are trying to validate an XML against a DTD using XDK 9.2.0.5.0 and it fails. The same XML was validated without any problem earlier, but, suddenly started failing with the following error. XML-0201: (Fatal Error) Expected name instead of .

  • No 'application' on my mac to start download of photoshop, what do I need?

    I have just bought photoshop and want to start down loading it but this message comes up - 'There is no application set to open the URL aam://SAPCode=PHSP?productVersion=14.0?passPhrase=W7MNUgZB97NrFrRPytwKMy/NfyL/oASgW6T6GKO ieWWLcQ6W0iWEN8fIZbhPkYH

  • Sudden rubbish sound coming through iTunes

    Now this is a confusing one for me. A CD which in the year since I downloaded it and which sounded fine when played back through iTunes has suddenly started to sound dreadful with distortion, mainly at the bass end. It sounds like (a) the volume cont