Re: dispatch_apply strange results

2014-02-09 Thread Kyle Sluder
On Sat, Feb 8, 2014, at 11:35 PM, Gerriet M. Denkmann wrote: But using two threads takes much longer than just using one! How could this happen? Because now you've got two CPUs fighting over one cache line? Optimization is hard. Throw more threads at it is not a panacea. --Kyle Sluder

Re: dispatch_apply strange results

2014-02-09 Thread Gerriet M. Denkmann
On 9 Feb 2014, at 14:57, Kyle Sluder k...@ksluder.com wrote: On Sat, Feb 8, 2014, at 11:35 PM, Gerriet M. Denkmann wrote: But using two threads takes much longer than just using one! How could this happen? Because now you've got two CPUs fighting over one cache line? Optimization is

Re: dispatch_apply strange results

2014-02-09 Thread Quincey Morris
On Feb 9, 2014, at 00:19 , Gerriet M. Denkmann gerr...@mdenkmann.de wrote: But I would really like to understand what I should do. You might get a happier outcome by using a different approach that’s designed for this sort of the thing. For example: — One of the vector frameworks, like

Re: makeDocumentForURL:nil withContentsOfURL:fileURL causing deletion

2014-02-09 Thread Jerry Krinock
On 2014 Feb 08, at 11:43, Trygve Inda cocoa...@xericdesign.com wrote: However, if I close the window (thus closing the document) and choose to not save, the file package at fileURL is deleted. In order to keep a critical document from being deleted in this way, I think you should save it in

Re: dispatch_apply strange results

2014-02-09 Thread Greg Parker
On Feb 9, 2014, at 12:19 AM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: The real app (which I am trying to optimise) has actually two loops: one is counting, the other one is modifying. Which seems to be good news. But I would really like to understand what I should do. Trial and error

Re: dispatch_apply strange results

2014-02-09 Thread Gerriet M. Denkmann
On 9 Feb 2014, at 15:53, Greg Parker gpar...@apple.com wrote: On Feb 9, 2014, at 12:19 AM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: The real app (which I am trying to optimise) has actually two loops: one is counting, the other one is modifying. Which seems to be good news. But I

Re: dispatch_apply strange results

2014-02-09 Thread Kevin Meaney
The 2011 WWDC Blocks and Grand Central Dispatch in practice talks about cache line size which I believe is relevant here. You can read my notes from that session here: http://blog.yvs.eu.com/2013/07/blocks-and-grand-central-dispatch-in-practice/ Kevin On 9 Feb 2014, at 08:53, Greg Parker

Re: dispatch_apply strange results

2014-02-09 Thread Gerriet M. Denkmann
On 9 Feb 2014, at 15:53, Greg Parker gpar...@apple.com wrote: On Feb 9, 2014, at 12:19 AM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: The real app (which I am trying to optimise) has actually two loops: one is counting, the other one is modifying. Which seems to be good news. But I

NSGraphicsContext graphicsContextWithBitmapImageRep - Memory leak

2014-02-09 Thread Dany Golubitsky
I am having this part of code that gives me major memory leak: SBitmapImageRep* textRep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL

Re: Design pattern for bulk data handling

2014-02-09 Thread Ben
Thank you for the comments everyone, however I think I must have phrased the question badly. I am not looking for assistance on speeding up SQLite, more for designing a cleaner API that works well with this. I am already pretty familiar with SQLite and it's various options. To try and clarify:

Re: Can I Hide / Show an NSTextField / NSSecureTextField in Cocoa?

2014-02-09 Thread David Delmonte
Begin forwarded message: From: David Delmonte ddelmo...@mac.com Subject: Re: Can I Hide / Show an NSTextField / NSSecureTextField in Cocoa? Date: February 9, 2014 at 9:52:41 AM EST To: SevenBits sevenbitst...@gmail.com Maybe I'm misunderstanding what I need to do. Essentially, I want the user

Re: NSGraphicsContext graphicsContextWithBitmapImageRep - Memory leak

2014-02-09 Thread Ken Thomases
On Feb 9, 2014, at 4:56 AM, Dany Golubitsky wrote: I am having this part of code that gives me major memory leak: SBitmapImageRep* textRep = [[NSBitmapImageRep alloc]

Re: Can I Hide / Show an NSTextField / NSSecureTextField in Cocoa?

2014-02-09 Thread Jens Alfke
On Saturday, February 8, 2014, David Delmonte ddelmo...@mac.com wrote: Finally, does anyone know if the Mac App Store would accept an app with elevated permissions (admin permissions to enter a password)? (or am I confusing things?) Well, you still haven't explained what your app actually

Cocoa and OS X Security Frameworks

2014-02-09 Thread SevenBits
Hi all, I’m looking to add encryption support to an application I’m developing. I know that OS X includes a number of libraries and frameworks dedicated to encryption (such as Security.framework and OpenSSL) but I’m not sure whether I should use them as opposed to a different library like

Re: Cocoa and OS X Security Frameworks

2014-02-09 Thread Giacomo Tufano
Il giorno 09/feb/2014, alle ore 23:33, SevenBits sevenbitst...@gmail.com ha scritto: I’m looking to add encryption support to an application I’m developing. I know that OS X includes a number of libraries and frameworks dedicated to encryption (such as Security.framework and OpenSSL) but

Re: Cocoa and OS X Security Frameworks

2014-02-09 Thread Jens Alfke
On Feb 9, 2014, at 2:33 PM, SevenBits sevenbitst...@gmail.com wrote: The idea of what I’m trying to do is create some simple encrypted files on the user’s hard drive to hold secret/confidential user data related to my application. How simple? If it's just passwords, or a few hundred bytes