Grand Central

2009-06-14 Thread David Chisnall
In case anyone hasn't seen this, Apple have published a few more  
details about Grand Central:


http://images.apple.com/macosx/technology/docs/GrandCentral_TB_brief_20090608.pdf

There is no API documentation yet, but it seems that it basically  
spawns a set of threads at different priorities and uses them to run  
blocks from various queues.  Lots of hype, but it doesn't seem to give  
anything that we can't already do with EtoileThread and clang (we  
already have an implementation of blocks and an efficient way of  
passing objects between threads - see ETThread and MKObjectPipe).


The most important improvement is hidden right at the bottom of the  
document; there is now a queue associated with the main thread, so  
there is a standard way of running arbitrary code at the end of the  
next run loop.


David


___
Gnustep-dev mailing list
Gnustep-dev@gnu.org
http://lists.gnu.org/mailman/listinfo/gnustep-dev


Re: Grand Central

2009-06-14 Thread Pete French
 http://images.apple.com/macosx/technology/docs/GrandCentral_TB_brief_20090608.pdf

Interesting - that ^{ syntax to describe a block is somewhat ugly, and it doesnt
give any deats of how you associate data with a block (which is necessary if
you want to get rid of locks).

It still all looks a bit heavyweight to me - I am still waiting for a 
parallelism
model as easy to use as OCCAM ... people really threw the baby out with the 
bathwater
there when the transputer died sadly :-(

 There is no API documentation yet, but it seems that it basically  
 spawns a set of threads at different priorities and uses them to run  
 blocks from various queues.  Lots of hype, but it doesn't seem to give  

I can't work out if GCD is supposed to be an extension for OSX or an extension
to Objective-C itself. Obviously the block syntax requiures a language 
extension,
but how do the bits fit together from there onward ?

-pete.


___
Gnustep-dev mailing list
Gnustep-dev@gnu.org
http://lists.gnu.org/mailman/listinfo/gnustep-dev


Re: Grand Central

2009-06-14 Thread Jens Ayton

On Jun 14, 2009, at 14:53, Pete French wrote:



http://images.apple.com/macosx/technology/docs/GrandCentral_TB_brief_20090608.pdf


Interesting - that ^{ syntax to describe a block is somewhat ugly,  
and it doesnt
give any deats of how you associate data with a block (which is  
necessary if

you want to get rid of locks).


There are two ways to pass data into blocks: constant copies from the  
parent scope, and mutable access to block variables in the parent  
scope (the latter makes blocks true closures). Here is a simple example:


typedef int (^IntIntBlock)(int);

IntIntBlock MakeExampleThing(int initial, int delta)
{
__block int accum = initial;
int (^block)(int) = ^(int i) { return accum += i + delta; };
return Block_copy(block);
}


In the block created above, accum is a block variable, and delta is a  
const copy. If MakeExampleThing() is called twice, they get separate  
copies of accum, so there's your data associated with the block. If  
two blocks were created in the same function, both referring to accum,  
they would share it.


int main(void)
{
int (^a)(int) = MakeExampleThing(5, 2);
int (^b)(int) = MakeExampleThing(1, 0);

printf(%i\n, a(3));  // prints 10
printf(%i\n, b(1));  // prints 2

Block_release(a);
Block_release(b);
return 0;
}


The block runtime is set up to allow blocks to be ObjC objects, so  
that Block_copy() and Block_release() can be replaced with retain and  
release messages. (Block_copy() is conceptually a retain operation,  
although it actually does copy in the above example because the block  
is initially created on the stack.)


In case the new syntax and manual memory management overhead gets in  
the way in the above code, here's a Javascript equivalent:


function MakeExampleThing(initial, delta)
{
return function(i)
{
return initial += i + delta;
}
}


I can't work out if GCD is supposed to be an extension for OSX or an  
extension
to Objective-C itself. Obviously the block syntax requiures a  
language extension,

but how do the bits fit together from there onward ?


Other than blocks, as far as I can see (I don't have Snow Leopard  
seeds) it's just a library and an optimized thread scheduler.



--
Jens Ayton



___
Gnustep-dev mailing list
Gnustep-dev@gnu.org
http://lists.gnu.org/mailman/listinfo/gnustep-dev


Getting reviews and submitting patches

2009-06-14 Thread Dave MacLachlan
Sorry for the newbie question, but I want to make sure I get it  
right ;-)


I've got a couple of patches that I'd like to submit to gnustep-base.  
Google has signed off on having them submitted to the project, so the  
legal steps are taken care of already.


a) Is there a coding standard for gnustep somewhere that I missed?  
Right now I'm guessing no.

b) How do people normally handle reviews?
c) Anything else I should know before diving into the world of  
submitting patches?


Cheers (and thanks),
Dave


___
Gnustep-dev mailing list
Gnustep-dev@gnu.org
http://lists.gnu.org/mailman/listinfo/gnustep-dev


Re: Getting reviews and submitting patches

2009-06-14 Thread David Chisnall

On 14 Jun 2009, at 17:20, Dave MacLachlan wrote:

Sorry for the newbie question, but I want to make sure I get it  
right ;-)


I've got a couple of patches that I'd like to submit to gnustep- 
base. Google has signed off on having them submitted to the project,  
so the legal steps are taken care of already.


Have you filed a copyright assignment form with the FSF?  As a GNU  
project, contributors to GNUstep are required to do this.  The FSF  
still owes me $1 from mine though...


a) Is there a coding standard for gnustep somewhere that I missed?  
Right now I'm guessing no.


GNUstep is a GNU project, so the GNU coding styles apply.  These are  
widely ignored in GNUstep, however, because they are absolutely  
atrocious (worse than Google's, but not quite as bad as LLVM's).  They  
were originally created as a 'compromise' between the BSD and ATT  
coding conventions, and managed to combine the worst aspects of both.



b) How do people normally handle reviews?


Post patches to the list, and if no one reviews / commits them,  
complain until they do (well, that's how I do it...).  As far as I  
know, there is no formal code review system (yet...).


c) Anything else I should know before diving into the world of  
submitting patches?


Nothing springs to mind.  The first step is doing the copyright  
assignment.


David


___
Gnustep-dev mailing list
Gnustep-dev@gnu.org
http://lists.gnu.org/mailman/listinfo/gnustep-dev


Re: NSCalendar and NSLocale support

2009-06-14 Thread Lars Sonchocky-Helldorf


Am 14.06.2009 um 23:10 schrieb Riccardo Mottola:


Hi,

Dave MacLachlan wrote:

Hey there...

I'm looking to add NSCalendar and NSLocale to Foundation. I'm  
happy to implement them, but I was hoping to do it on top of ICU  
(http://site.icu-project.org/).


Are we willing to add a dependency on ICU to gnustep?


This is a typical dilemma. Usually I am a friend of having the  
smallest set of dependencies possible. I checked and ICU is for  
example readily available in gentoo (if not, I would have really  
worried) but it is not for example available on sunfreeware, this  
tells me that it is not that widespread.


Really? SUN should use it:

from http://site.icu-project.org/:

Companies and Organizations using ICU
ABAS Software, Adobe, Apple, Amdocs, Apache Xalan XSLT, Apache Xerces  
XML, Argonne National Laboratory, Avaya, BAE Systems Geospatial  
eXploitation Products, BEA, BroadJump, BluePhoenix Solutions, BMC  
Software, Boost, Business Objects, caris, CERN, Debian Linux, Dell,  
Eclipse, eBay, EMC Corporation, ESRI, Free BSD, Gentoo Linux, Google,  
GroundWork Open Source, GTK+, HP, Hyperion, IBM, Inktomi, Innodata  
Isogen, Informatica, Intel, Interlogics, IONA, IXOS, Jikes,  
Mathworks, Mozilla, Netezza, OpenOffice, Lawson Software, Leica  
Geosystems GIS  Mapping LLC, Mandrake Linux, OCLC, Progress  
Software, Python, QNX, Rogue Wave, SAP, SIL, SPSS, Software AG, Sun  
Microsystems (Solaris, Java), SuSE, Sybase, Symantec, Teradata (NCR),  
Trend Micro, Virage, webMethods, Wine, WMS Gaming, XyEnterprise,  
Yahoo!, and many others.


Products from IBM
Ascential Software, Cognos, PSD Print Architecture, DB2, COBOL, Host  
Access Client, InfoPrint Manager, Informix GLS, iSeries, Language  
Analysis Systems, Lotus Notes, Lotus Extended Search, Lotus  
Workplace, WebSphere Message Broker, NUMA-Q, OTI, OmniFind, Pervasive  
Computing WECMS, Rational Business Developer and Rational Application  
Developer, SSS Websphere Banking Solutions, Tivoli Presentation  
Services, Tivoli Identity Manager, WBI Adapter/ Connect/Modeler and  
Monitor/ Solution Technology Development/WBI-Financial TePI,  
Websphere Application Server/ Studio Workload Simulator/Transcoding  
Publisher, XML Parser.


Products from Google

Web Search, Chrome, Android, Adwords, Google Finance, Google Maps,  
Blogger, Google Analytics, Google Gears, Google Groups, and others.

Products from Apple

Mac OS X, iPhone OS, Safari for Windows, Apple Mobile Device Support  
in iTunes for Windows.



___
Gnustep-dev mailing list
Gnustep-dev@gnu.org
http://lists.gnu.org/mailman/listinfo/gnustep-dev