Slashdot Log In
Intel Releases Threading Library Under GPL 2
Posted by
CmdrTaco
on Wed Jul 25, 2007 09:02 AM
from the of-interest-to-some-of-you dept.
from the of-interest-to-some-of-you dept.
littlefoo writes "Intel Software Dispatch have announced the availability of the Threading Building Blocks (TBB) template library under the GPL v2 with the run-time exception — so this previously commercial only package is now open for all the use, whether for open-source projects or commercial offerings (although they are explicitly encouraging open source use). The interface is more task-based then thread-based, but with a somewhat different view of things than, e.g. OpenMP.
From the Intel release: 'Intel® Threading Building Blocks (TBB) offers a rich and complete approach to expressing parallelism in a C++ program. It is a library that helps you leverage multi-core processor performance without having to be a threading expert. Threading Building Blocks is not just a threads-replacement library. It represents a higher-level, task-based parallelism that abstracts platform details and threading mechanism for performance and scalability.'"
This discussion has been archived.
No new comments can be posted.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
Full
Abbreviated
Hidden
Loading... please wait.
Woohoo (Score:3, Insightful)
GPL 2 (Score:3, Informative)
"Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation"
You can of course get it as GPL 3....
Re: (Score:2, Offtopic)
Try to take my very crappy and unimportant GPLv2 code (note, not GPLv2 or any later version) and relicense it/use it with GPLv3 code and you'll be getting a letter from my lawyer. I dare you to do it to IBM.
Re: (Score:2)
Re:GPL 2 (Score:4, Informative)
Simply put, you can link in the code as a library without worrying about LGPL's library requirements. (Namely the need to be able to replace the library with an upgraded version.) Intel notes that this is necessary for C++ libraries because of the way they have to be linked.
For the parent's code, I doubt he chose to have this clause in the GPL he chose, and it wouldn't be possible with his.
Parent
Re: (Score:3, Interesting)
You are correct that Intel's code would be used by the final program. (I hesitate to say 'become part of' because it's still a seperate library, just used by the program. When you wear glasses, they don't become part of you, no matter how necessary they are to your continued existance.)
Re: (Score:3, Interesting)
Actually it says (and "any later version").The part of the program that says this is licensed under the GPL would have to say the "OR" version. The portion you and many others who don't know the GPL well enough to discern the intent pick the part outside the GPL entitled how to apply this for reference. It isn't part of the GPL and it isn't anything ot
Re: (Score:3, Informative)
Re: (Score:2, Informative)
No you can't.
GPL 2 only (Score:3, Informative)
# Copyright 2005-2007 Intel Corporation. All Rights Reserved.
#
# This file is part of Threading Building Blocks.
#
# Threading Building Blocks is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License
# version 2 as published by the Free Software Foundation.
There's no "Or Later" in there. This is GPL v2 only.
Re:GPL 2 only (Score:5, Interesting)
-nB
Parent
Open-Source vs Commercial? (Score:3, Insightful)
I'm glad to hear it (Score:5, Informative)
Looks good, but a little hampered by C++ (Score:5, Insightful)
But. As much as I love C++ ( and I do ) the real weakness is the lack of usable closures/lambda. The parallel_for example requires you to pass a functor to execute on ranges, which is fine, it makes sense, but since you can't define the closure in the calling-scope in C++ you end up filling your namespace with one-off function objects.
This is not a critique of TBB, but rather of C++. In java I can make an anonymous subclass within function scope. In python and hell even javascript I can make anonymous functions to pass around. But in C++ I can't, and this means that my code will be ugly.
Not that this is new news. I use Boost.thread for threading right now, and most of my functors are defined privately in class scope ( which is, at the very least, not polluting my namespace ) but it's too bad that I don't have a more elegant option in C++.
That being said, Boost.lambda makes my brain hurt a little, so my complaints are really just a tempest in a teacup. If I were smarter and could really grok C++ I could probably use Boost.Lambda and this would be a non-issue.
Re: (Score:2, Insightful)
Besides how hard is it to multicore manually, you can either subdivide a major loop, if its warranted, if it lasts 1us then its useless or
you might as well subdivide at the highest level. ie AI/AUDIO/3D
Javascript, even if running on 16 5ghz cores, would still be slower than 1 core 3ghz, so its a mute benefit of its 'magic functions'
I wouldn't want to depend on a generic system to make my random function appear faster, rather design it we
Re: (Score:2)
i rather have the other core free
I don't know your setup, but you've made the schoolboy error of assuming that everyone has 2 cores. I suppose in the future, you'll be the guy complaining that your new 64-core CPU only uses 2 of them, "why can't app writers figure out how many cores I have and use them all"
You don't need a core free to run apps, and having functors is a well established C++ paradigm for creating code, they're not any worse than calling a simple C function (even if they look strange sometimes - the compiler does all the wo
Re: (Score:2)
Then I guess you'll be happy to hear that the proposal [open-std.org] for lambda expressions is well on its way to getting included in C++09.
But the thing is (Score:4, Informative)
You'll find that this is rather evident in most games. While it is increasingly common to write large portions of the game in a scripting language since that make it easier to write and perhaps more importantly easier to mod, you'll find that the high speed stuff is still C++. Take Civ 4 for example. They wrote almost the whole damn game in XML and Python. All data (like unit definitions, technology tree, etc) is stored in XML files, all the scripting necessary to make them work is Python. Makes the game extremely easy to mod. However, the AI code, which they also released to end users, is in C++. The reason is that the AI is highly intensive and would have run too slow in Python. Also, the core engine of the game (not released to users) is C++ as well.
So it isn't surprising this is where Intel is targeting their optimisations. Also, I'd argue that to a large degree any of this kind of thing for a managed language is the responsibility of the runtime itself. If Java is to have better support for automatically threading things, the JRE is probably where that should be done.
Parent
A job for Fortran . . . (Score:3, Informative)
Fortran 90 and later already have the structures for this (Forall, etc).
*sigh*
hawk, who hasn't written a line in over two years
Re: (Score:2)
Re: (Score:3, Informative)
Local _functions_ aren't in C++, but may be a GCC extension - which might be confusing you.
Re:Looks good, but a little hampered by C++ (Score:4, Informative)
Local classes / structs do not have external linkage and therefore can't be used as template arguments. So, for functors etc., which is precisely where you'd want something like a local class (ie. because you really want a closure), they are useless.
Hence why we have Boost lambda. Expect, and I agree with the GP, the syntax ends up so horrible (due to the constraints of C++, not in any way the fault of the Boost devs) that you end up not using it. Not a lot of point in trying to do something because it is technically cleaner and neater if it ends up unreadable and therefore unmaintainable (for that, there is always Perl).
Parent
Great news! (Score:2, Interesting)
This and XEN (Score:2)
Question: With this now GPL2 and open source, will this fix one of the problems of XEN?
XEN can only be run on certain processors when used with particular OSes, XP, namely. And, as I understood it, it was because of the threading. If XEN incorporates this into their system, will this open the door?
Re: (Score:3, Interesting)
Difficult to implement (Score:2, Interesting)
Compatibility kinda sucks (Score:2, Informative)
I know this comes as a great surprise, but the OSes and processors this runs on are limited [intel.com]. If you want your programs to run on non-Intel platforms, or on any of the BSDs, I suggest you skip it and use something else.
Processors:
Re: (Score:2)
Well, yeah, considering it's an Intel software product, that Intel originally released under a closed-source license and probably charged a nominal fee for. (Intel's software is used to promote their hardware, after all, so even if they give it away for free, they don't lose out since their li
Re: (Score:2)
Since its GPLv2 rather than closed, to the extent that it is a useful library and easier to adapt to other processors/OS's than implement the API or an equally useful one from scratch, there is at least the potential of community-driven implementations for other environments.
Re:Compatibility kinda sucks (Score:4, Informative)
The commercial product information quoted does not include some ports which were completed for the open source project only days before the open source release.
Preparing for open source, we were able to get G5 for Mac OS X as well as support for Solaris and FreeBSD (both x86 and x86-64) working before releasing on Tuesday. It was tight - but they made it. I wasn't sure until the week before what we would have - but the team got them working. I think it will be easier now that the project is started - and we can let other join in to help us.
I should also say we got a bunch more Linux distributions working for builds too. We have tested them enough to see no issues - but we haven't enough experience to call them supported on the product pages (commercial product). Please look for the latest ports on the open source project threadingbuildingblocks.org. We'll work with anyone who has processors/system expertise and needs any advice we can offer. Understandably, we don't have a lot of non-Intel hardware inside Intel to test upon and we are hoping others can help a bit with that.
For compilers - we have gcc, Intel, Microsoft and Apple (gcc in Xcode environment) compilers all working with the builds. It seems like we may have something to do for Sun's compilers and/or environment working - some Sun engineers are in touch and helping us double check this. No schedule - just working together - which I have faith will get results to put out in an updated open source copy in the not too distant future - non-binding wish - this is not a promise
The biggest issues from processor to processor is knowing how to implement a few key locks, and atomic operations, best in assembly language. Since we have support for processors with both weak and strong memory consistency models - we know TBB is up to the task.
TBB is very strongly tied to shared memory, and so a port to a Cell processor (or a GPU) would be a bit more challenging - but might be doable for the Cell. We've had only a few discussions/thoughts - no progress I know of figuring out a good approach there. That will almost certainly take someone with more Cell experience than we have at this time. I'm open to learning - but I'd need a teacher for sure.
Parent
Re:Compatibility kinda sucks (Score:4, Informative)
Parent
GPLv2 only (Score:3, Informative)
This doesn't surprise me much, actually - I imaging Intel wouldn't want to commit their code to an unknown future license, and I expect they're still evaluating GPLv3. Even if they were done with that evaluation, the process for releasing this under v2 probably took a LONG time to complete - Intel is after all a large corporation. Restarting with GPLv3 probably would have just delayed it, although I suppose the only ones who would actually know that work for Intel.
Re: (Score:3, Informative)
I would not. The verbatim GPLv2 states:
If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions eithe
Memory requirements - bummer (Score:3, Interesting)
I read on their FAQ that TBB requires 512MB to run, though they recommend 1GB. This appears to be very high, especially when compared to Boost.Threads etc. I can't think of a reason why they need to allocate this much - and it would probably be a problem for consumer applications.
Also from the FAQ, the so-called concurrent containers still need to be locked before access. So no change from normal STL containers there.
But I will download it just for the memory allocator they supply, since it can be plugged into STL, and claims to hand out cache-aligned memory. It can apparently be built independently of the rest of TBB.
"open-source" != "non-commercial" (Score:2)
The antonym of "open-source" is "closed-source" or "proprietary". Anyone telling you you can't use and distribute GPL'ed software commercially is in violation of the GPL.
Re:As if enough people weren't already confused... (Score:4, Informative)
Parent
Re:As if enough people weren't already confused... (Score:4, Informative)
Agreed it does look to take a lot of the grunt work out of writing parallel-processing code. There are supposedly Java and
Parent
Re: (Score:3, Insightful)
Re: (Score:2, Insightful)
That said, I'm sure most CS courses teach at least the basics of memory management, but people are still happy to rely on the Java garbage collector
Re: (Score:2)
Re:task based then thread based (Score:5, Funny)
Obviously you are in the those who don't group.
Parent
Re:task based then thread based (Score:4, Funny)
The then/than mixup is kind of funny though. Reminds me of something I read in the engineering faculty on a white board (I assume a first year engineer):
"I'd rather be retarded then do my engineering homework.."
Looks like he had the pre-requisite fulfilled and should have just got on with the homework.
Parent
Re: (Score:2)
And obviously it's your fault.
Re:I'm thinking (Score:5, Informative)
And, if there was, well it's under the GPL now, and I'm sure someone would have added / corrected that mistake.
Parent
Re: (Score:3, Insightful)
Neither Linux nor Intel specific (Score:3, Informative)
It is neither Linux nor Intel specific
http://threadingbuildingblocks.org/ [threadingb...blocks.org]
Cross platform support:
* Provides a single solution for Windows*, Linux*, and Mac OS* on 32-bit and 64-bit platforms using Intel®, Microsoft, and GNU compilers.
* Supports industry-leading compilers from Intel, Mi
PS3? (Score:4, Interesting)
Hmmm, it may be one of my first projects; six cores running @ 3.2GHz and an easy method of putting them to use. It would be interesting to parallelize pi calculation and see how long it would take to get one million digits.
Parent
Re:PS3? (Score:4, Informative)
Parent
Re: (Score:2, Informative)
http://softwarecommunity.intel.c [intel.com]
Re: (Score:2)