• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSArchiver atomic?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSArchiver atomic?


  • Subject: Re: NSArchiver atomic?
  • From: Clark Cox <email@hidden>
  • Date: Sun, 29 Mar 2009 12:41:43 -0700

All bets are off if you do unsupported things inside of a signal
handler. For instance it is possible that the routines used to write
the file *seemed* to complete successfully when they, in fact, didn't.
In which case the code went along its merry way and did the rename.

On Sun, Mar 29, 2009 at 12:35 PM, Michael Vannorsdel <email@hidden> wrote:
> Yes no surprise..
>
> But if NSArchiver is indeed atomic I would think the saved file would either
> be saved complete with new data or complete old data and not with partial
> data in situations like an untimely crash or resource loss.  Unless I have
> the wrong expectation of atomic file writes, which I thought was writing to
> a temp file and doing a rename at the end to avoid partial state files at
> the destination.
>
>
> On Mar 29, 2009, at 1:04 PM, Michael Ash wrote:
>
>> You cannot run arbitrary code from a signal handler. The sigaction man
>> page has a list of what library functions *can* be called from a
>> signal handler. *Everything* else is off-limits, including all of
>> Cocoa and all of the Objective-C runtime.
>>
>> You were doing it wrong, now you're doing it right, and your problem
>> went away. Seems like no surprise there!
>
> _______________________________________________
>
> 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
>



--
Clark S. Cox III
email@hidden
_______________________________________________

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

  • Follow-Ups:
    • Re: NSArchiver atomic?
      • From: Michael Vannorsdel <email@hidden>
References: 
 >NSArchiver atomic? (From: Michael Vannorsdel <email@hidden>)
 >Re: NSArchiver atomic? (From: Jim Correia <email@hidden>)
 >Re: NSArchiver atomic? (From: Michael Vannorsdel <email@hidden>)
 >Re: NSArchiver atomic? (From: Michael Ash <email@hidden>)
 >Re: NSArchiver atomic? (From: Michael Vannorsdel <email@hidden>)

  • Prev by Date: Re: should release or not? (basic memory management question)
  • Next by Date: Re: NSArchiver atomic?
  • Previous by thread: Re: NSArchiver atomic?
  • Next by thread: Re: NSArchiver atomic?
  • Index(es):
    • Date
    • Thread