Re: Un-mounting of first DMG is taking 15secs
Re: Un-mounting of first DMG is taking 15secs
- Subject: Re: Un-mounting of first DMG is taking 15secs
- From: Sravana Kumar <email@hidden>
- Date: Sat, 4 Sep 2010 15:16:47 +0530
Hi All,
I faced the same issue in another workflow and this time I could narrow down
the issue easily.
Nearly after 9 months I found the reason, but it is in another workflow.
Issue is:
After calling FSFindFolder method, if we mount/unmount dmg in a thread using
'hdiutil' command then the first dmg will take 15-16 seconds to unmount.
This should be an apple bug.
It is very simple to reproduce, here are the steps:
1. call FSFindFolder(kSystemDomain, kApplicationSupportFolderType, true,
&appFolderRef);
2. detach thread.
3. mount and unmount dmg using 'hdituil' in the detached thread function.
I attached the very small sample code which demonstrates the issue.
Here are the steps to execute sample code.
1. Unzip DMGissue.zip
2. cd "to DMGissue folder".
3. make
If you observe logs, the time difference for the first dmg unmount is more
than 15 seconds.
Any comments ?
Regards,
-Sra1
On Wed, Dec 2, 2009 at 11:43 AM, John Joyce <
email@hidden> wrote:
>
> On Dec 1, 2009, at 11:03 PM, email@hidden wrote:
>
> > Hi all,
> >
> > In my application I need to mount and un-mount DMGs, but in one specific
> > workflow un-mounting of first DMG is taking 15secs of time.
> >
> > I am using Œhdiutil‚ command and NSTask with the following options ...
> > Mounting:
> > hdiutil attach <dmgPath> -noverify ˆnoautoopen ˆnobrowse ˆnoautofsck
> > ˆreadonly ˆquiet -mountpoint <tryMoutPath>
> > Unmounting:
> > hdiutil detach <dmgPath> -quiet
> >
> > I am using NSTask, waitUntilExit method for every mount and un-mount. As
> I
> > want mounting, un-mounting to be sync operations.
> >
> > Only first un-mounting is taking 15secs time, if I won‚t wait for
> > un-mounting and and try mounting the second DMG then the second DMG mount
> is
> > also taking 15secs time. It means either unmounting of first dmg or
> mounting
> > of second dmg is taking time. The same code is not taking time in many
> other
> > workflows.
> >
> > In the specific workflow which is taking time, my application is being
> > launched by another root privileged process.
> >
> > Do any one faced this type of issue ? Or any suggestions ?
> >
> > Thanks and Regards,
> > -Sra1
> Without posting code or more detail on these "workflows" as well as what
> you have tried, it is unlikely you will get much of a response.
> Based on "sometimes it takes a long time" then that would indicate
> something is still happening.
> If a process is running from the dmg, then it cannot unmount until that
> process ends.
> Example: if you launch an app that is inside of a dmg, or on another volume
> external to the boot volume, you cannot unmount that volume until that app
> is terminated in some fashion.
> You may want to try monitoring the processes running (top is a good unix
> tool for this)
> or fseventer ...
>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
Attachment:
DMGissue.zip
Description: Zip archive
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden