discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: General question about GNUStep


From: Simeon Mitev
Subject: Re: General question about GNUStep
Date: Thu, 27 Aug 2009 12:24:28 +0200
User-agent: Thunderbird 2.0.0.23 (Macintosh/20090812)

Is it not going about compiler possibilities to optimize the code using hyper threading? OpenMP is a specification trying to get a standard for such things, I hope, I have it not totally misunderstood.

Is ObjC compiler just an extension to the common GNU C compiler (100% compatible) or it is a standalone realization which can also compile C code.

In example:

# pragma ..... - explicitly enabling hyper threading
for( int i=0; i<n; i++)
  a[i] = b[i]*x + c[i]*y;

Lets say n is supposed to have the value 100 000.

When you compile this enabling hyper threading the compiler can prepare code which will execute at this point lets say 10 threads. Each thread will do the same but for different scopes for i:

T1: i = 0..9999;
T2: i = 100000 ... 199999;
T3: ...
T10 i = 90000  ... 999999;

At the end the a array will be calculated for ways shorter time than one thread with 100 000 iterations, because each processor core will take part of this calculation.

GNU gcc (4.3.2) has already an option and you can compile with -fopenmp .

My question was: Does ObjC compiler handle also the same feature or it does not?


Hi,

On Thu, Aug 27, 2009 at 9:12 AM, Simeon Mitev<develop@paymobile.me> wrote:
Of course, I meant native hyper threading support :)

Nice Nicola,

Thank you for the good presentation!

I have got answers for some of my questions. What I am still interested in
is multi threading support in objC compiler and runtime. While the server
application will run on unix with 2 quad core processors I will definitively
need to use multi threading to get a real benefit from the hardware. In C++
I can use also openMP (http://openmp.org/wp/) in example. Thoughts ?

OpenMP is for shared memory multiprocessing, not just multithreading.
It's also available in C, so you can directly use it in Objective-C if
you want...

Objective-C and GNUstep do support multithreading (see NSThread). Have
a look also at Etoile's EtoileThread implementation,
http://svn.gna.org/viewcvs/etoile/trunk/Etoile/Frameworks/EtoileFoundation/EtoileThread/
(which let you trivially run an object in a separate thread and
implements futures for returned values,
http://en.wikipedia.org/wiki/Futures_and_promises), it's _really_
nice.

It looks like I will go back to C++ or Java for the server,
Why?  Objective-C is much better than either... it's a very good server
solution (C++ is too inflexible and Java is slow/clumsy).
Yes! :-)

Simeon,

you can check my  "Building server applications using Objective-C and
GNUstep" Fosdem 2009 presentation on

 http://www.gnustep.it/nicola/Presentations/index.html

if you're interested in a quick summary overview.  If you're starting
from scratch, and are using Objective-C on the client anyway, it's really
worth for you to consider writing your server in Objective-C too - even if
they talk to each other using a custom, language-independent protocol. ;-)

Anyway, whatever you choose to do, good luck with your project. :-)

Thanks



_______________________________________________
Discuss-gnustep mailing list
Discuss-gnustep@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnustep



_______________________________________________
Discuss-gnustep mailing list
Discuss-gnustep@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnustep



_______________________________________________
Discuss-gnustep mailing list
Discuss-gnustep@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnustep









reply via email to

[Prev in Thread] Current Thread [Next in Thread]