Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror
×
Be Operating Systems Programming Software IT Technology

Will Pervasive Multithreading Make a Comeback? 657

exigentsky writes "Having looked at BeOS technology, it is clear that, like NeXTSTEP, it was ahead of its time. Most remarkable to me is the incredible responsiveness of the whole OS. On relatively slow hardware, BeOS could run eight movies simultaneously while still being responsive in all of its GUI controls, and launching programs almost instantaneously. Today, more than ten years after BeOS's introduction, its legendary responsiveness is still unmatched. There is simply no other major OS that has pervasive multithreading from the lowest level up (requiring no programmer tricks). Is it likely, or at least possible, that future versions of Windows or OS X could become pervasively multithreaded without creating an entirely new OS?"
This discussion has been archived. No new comments can be posted.

Will Pervasive Multithreading Make a Comeback?

Comments Filter:
  • OSes like BeOS and Zeta are ahead of their time. With 8 core cpus coming out soon it just makes since with this technology... no programming tricks are needed.
  • Better than xubuntu (Score:4, Informative)

    by fishthegeek ( 943099 ) on Sunday July 15, 2007 @04:18PM (#19870105) Journal
    for older (p2 & p3) laptops. I have the opportunity several times a year to receive old laptops to use to teach my students with. Whenever I need to I use Beos Max on the machines and it is just amazing to watch how effecient and responsive Beos really is.

    Check out Beos Max [beosmax.org]

    Beos is still a lot of fun on older hardware.
  • by tolan-b ( 230077 ) on Sunday July 15, 2007 @04:31PM (#19870207)
    Haiku is coming along very nicely though, and it's open source.
  • Amiga beat them all (Score:4, Informative)

    by Anonymous Coward on Sunday July 15, 2007 @04:37PM (#19870265)
    Serious back in the mid 1980's I used to love putting PC and Mac owners to shame by showing them literally dozens of open, active graphics applications displaying animations, while formatting a floppy disk, and downloading a file online, and still having a normal responsive system with no hic-ups, all in a computer with on 128MB RAM.

    Amiga was a multi-tasking, multi-threaded OS, with multiple processors (graphics and I/O were separate co-processors operating on opposite clock cycles from the CPU, and the graphics co-processor could be dynamically loaded with special executable code).

    It was so far ahead of it's time that people today still don't believe it existed in the 80's when I tell them about it.

    But just because it was better than everything else did not assure it's success. A concept the BeOS fanbois might be familiar with.
  • by Urusai ( 865560 ) on Sunday July 15, 2007 @04:37PM (#19870269)
    Part of the problem is that Windows was originally a cooperative multitasking environment (like MacOS). When they added real threading (in Windows 95, I think), each application was still single threaded, which meant having the GUI and underlying processing on the same thread, making responsiveness sucky. They never bothered making the OS interface (Explorer) multithreaded, which is why on XP you can still crash Explorer and thus your entire desktop (although Explorer restarts after a few seconds).

    My experiences with Linux show it suffers big time from process hogs, especially IO process hogs, such as when you copy large directories, even with the low-latency desktop kernel options enabled, so don't think it's just a Windows problem.
  • by PCM2 ( 4486 ) on Sunday July 15, 2007 @04:45PM (#19870321) Homepage

    MS have also added some more interesting stuff to the scheduler in Vista, which helps with uninterrupted sound or movie playback, so at least some of that stuff is possible without a complete redesign.

    Really? Man, tell that to my box running Vista Media Center. Media Center has a helpful (cough) habit of capturing the mouse cursor to the screen running the Media Center app. Hit the Windows key to break out of it and your video playback is interrupted for as much as 20 seconds while Windows struggles to switch screens and render the Start menu. What's more, despite the fact that Vista has been re-engineered to support multiple sound output devices, it is not possible to assign one particular device to Media Center. In other words, you cannot force Media Center to always use your SPDIF output for sound and then use the computer speakers for other apps. You MUST specify SPDIF as the default sound device for the entire OS if you want Media Center to output sound in that way. It's clear that, for as powerful and multi-thread capable as modern hardware may be, Vista Media Center was written with the assumption that your PC will become a single-purpose appliance. It's kinda pathetic.

  • by kripkenstein ( 913150 ) on Sunday July 15, 2007 @04:51PM (#19870369) Homepage

    Multithreaded won't be optional any more.[...] Given that most machines are already starting to come default with 2 cores, and you can fit 8 cores (2 CPUs) in a nice desktop package, it's pretty clear that it's going to be a requirement.
    Sure, the trend towards more cores does imply that an inherently multithreaded OS makes more sense. But on the other hand, the main advantage heard about such pervasive multithreading is 'better responsiveness', and I am not sure that modern OSes are 'unresponsive' - current Linux desktops seem very responsive even when running multiple apps (except Firefox, btw, which locks up often for a second or two on intensive websites. Annoying, but still the best browser out there.)

    So, I am not convinced a rewrite of an OS just to add pervasive multithreading is a good idea. Anyhow, for those interested in that concept, there is Haiku [haiku-os.org], which is the FOSS OS inspired by BeOS. Looks like they are making nice progress (but nothing you'd want as your main productivity OS just yet).
  • Re:No Maybe Yes (Score:5, Informative)

    by someone300 ( 891284 ) on Sunday July 15, 2007 @05:08PM (#19870497)
    X is being fixed, thankfully (finally). There are a lot of interesting projects, including but not limited to Xegl. Xegl, is the long term goal of the X server and pretty much reduces the X server to a tiny part of the system, basically mediating the input devices, rotation and display management and TCP/over-the-wire GL, if I understand correctly, by using the Embedded GL specifications.
  • by GreggBz ( 777373 ) on Sunday July 15, 2007 @05:11PM (#19870523) Homepage
    Hey, I'm all for Amiga's but in the mid Eighties, if you had 128MB of ram and was downloading a file online, you must have been from the future.
    What the heck are you talking about?

    Just to be a little more correct here, I'm no hardware engineer but will try to be far more accurate.

    The Amiga had a great messaging system in it's OS, you could easily pass messages to other windows and programs in intuition. Further, you had all that ARexx stuff, and you could script programs to interact very easily with it. Basically, every program could listen on it's own ARexx socket for commands from other programs. Of course, there was the poor (read, no) memory protection which made things very unstable if you did not know what you were doing. Despite all this cool stuff, the OS was actually the weakest link. It was rushed. I remember reading specs on the original intended, but non-implemented file system, and it was about as robust as a single user file system could possibly get.

    You also had preemptive multitasking (not true co-operative) and a fantastic unified memory architecture with a very fast blitter. Another nice thing was
    that the kernel was contained on ROM so that it booted quicker then any other platform of it's day, and still faster then most this day. And all those chips played nice
    and were synced to an internal clock that ran on NTSC (or PAL) timings. This, of course, meant that interrupts worked seamlessly, and the chipset was handily compatible with video signals from television equipment. That last thing turned into an incredible boon for the entire film and television industry.

    The strength of the Amiga was it's bus and it's architecture. They absolutely nailed so many things in it's design, it really was a thing of beauty.
  • by Anonymous Coward on Sunday July 15, 2007 @05:31PM (#19870683)
    Corrected the memory size in another reply. The base system had 256KiloBytes of RAM. Sorry for the mix up, I'm so used to putting MB after memory sizes. ;-)

    As for downloading files online, back then "online" meant downloading from BBS systems. The closest thing to the internet back then for the average consumer was FidoNet.

    http://en.wikipedia.org/wiki/Fidonet [wikipedia.org]

    And yes, the lack of an MMU, as well as a lack of FPU, in the CPUs used in the early models was a shame. But it did keep the price of the system within reach of the average Joe Computer Geek.
  • Re:Puh-lease (Score:2, Informative)

    by brantondaveperson ( 1023687 ) on Sunday July 15, 2007 @05:49PM (#19870793) Homepage
    Got to correct this particular piece of nonsense:

    gcc does thread-safe initialization of local static variables -- Visual C++ does not.
    VC++ does do threadsafe static initialization. And in any case, gcc runs on windows so it's not exactly a windows issue is it?
    Windows has better support for multithreaded apps, it has a far richer set of thread/process synchronisation objects (mutexs, critical sections, semaphores, alertable wait states, events) than unix does.

    Now, as far as 32k 'busy' running threads leaving the machine still responsive... let's just try that out..

    DWORD WINAPI Th(LPVOID){ while(true); }
    int main(int,char**) { DWORD id; for(int n = 0; n < 31999; n++) { CreateThread(0,0,Th,NULL,0,&id); } while(true); return 0; }

    And I can report that yes, you're quite right, Windows is pretty much killed stone dead running these two lines of code. I'd love to hear a report from how Linux does running the equivalent.

  • by Anonymous Coward on Sunday July 15, 2007 @05:58PM (#19870839)
    Apple are adding the NSOperation and NSOperationQueue in Leopard to help with creating multithreaded applications. There's no public documentation on these yet, but based on what has been told in public it seems that it's mainly a worker thread API.
  • Re:I don't get it (Score:3, Informative)

    by nanosquid ( 1074949 ) on Sunday July 15, 2007 @06:17PM (#19870963)
    Let me know when a modern linux system can asynchronously notify a process that a file/directory has been modified.

    You mean--like every one? Beagle uses it, and so does Nautilus. It's been there for a number of years.
  • WalterCon (Score:1, Informative)

    by Anonymous Coward on Sunday July 15, 2007 @06:20PM (#19870989)
    If someone want to see BeOS and it's open source counterpart in action and you live close to san-francisco, try to attend waltercon 2007 in august http://haiku-os.org/ [haiku-os.org] (registration are open).

    On the subject of multithread, it could be interesting if individual or computer store could bring some mad hardware for testing purpose. The amount of knowlegable folk present + the usual casual feel of the event would make that very possible think.
  • Re:Question... (Score:3, Informative)

    by PygmySurfer ( 442860 ) on Sunday July 15, 2007 @06:41PM (#19871143)
    I believe the mere fact he mentioned the HURD is sufficient proof that he was not being serious.
  • current Linux desktops seem very responsive even when running multiple apps

    I'm guessing you never used BeOS; by comparison Linux looks weak in terms of responsiveness.
  • by drsmithy ( 35869 ) <drsmithy@ g m ail.com> on Sunday July 15, 2007 @09:00PM (#19872093)

    They never bothered making the OS interface (Explorer) multithreaded, which is why on XP you can still crash Explorer and thus your entire desktop (although Explorer restarts after a few seconds).

    Explorer has been multithreaded, well, basically forever. Certainly since at _least_ Windows 2000 and I'd happily wager since Windows 95 and NT4. P>The reason your Desktop disappears if Explorer crashes is because it's Explorer that is responsible for drawing the Desktop (and the Taskbar/Start Menu).

  • by dlockamy ( 597001 ) on Sunday July 15, 2007 @10:15PM (#19872511)
    huh? what BeOS are you talking about?

    libroot was in C, the api was all c++, but there was still a nearly posix subsystem in place via libroot.
  • Re:I hope so (Score:3, Informative)

    by Bryan Ischo ( 893 ) * on Sunday July 15, 2007 @10:33PM (#19872589) Homepage
    Yes, I used it. I paid $100 or more for it if I remember correctly. I was very excited about it, thinking it would be really cool. It definitely had nice demos. I don't know why it didn't open a debugger when I got errors trying to use the modem. I really don't. Who knows, maybe it did, and I've forgotten - it was 8 years ago. But in any regard, whereas I expected to be able to find documentation on how to configure the modem, how to manually force IRQs and DMA addresses and stuff, I found nothing. If it wasn't covered by one of the few GUI controls for that particular device, I couldn't do it. I gave up.

    Maybe there were workarounds that I didn't know about. I am not sure. All I know is I was never able to figure it out, and I went back to Linux in a hurry. It's possible that the problem was with me and that BeOS was an absolutely perfect, completely polished and bug-free product. People seem to be suggesting that's so. But my vote is "not worth it", and apparently the market agreed with me ...

  • by maztuhblastah ( 745586 ) on Sunday July 15, 2007 @11:06PM (#19872761) Journal
    I realize that I may be treading on shaky NDA ground, but I can say that Leopard makes some serious advances in this respect. I don't know if QuickTime and AppKit are fully multi-threaded yet -- but I can say that they seem to be a hell of a lot closer than in Tiger. Also, xnu has had a HUGE amount of work put into it in an effort to reduce locking situations, and it seems to have paid off -- a lot of stuff that would cause a UI hang in Tiger is no longer an issue in Leopard. It also seems that CoreVideo/CoreAnimation have been written with SMP situations in mind.

    That's about all I can say without the black helicopters descending on^NO CARRIER
  • by wall0159 ( 881759 ) on Sunday July 15, 2007 @11:31PM (#19872881)
    "128MB? In the mid 80s? Maybe you mean 4Mb :-)"

    Actually, I think the GP probably meant 128KB.

    My parents bought a 486SX33 in 1994, and that had 4MB, but in 1985....
  • by drsmithy ( 35869 ) <drsmithy@ g m ail.com> on Monday July 16, 2007 @12:37AM (#19873259)

    It wasn't until MS-Windows 2k that MS-Windows was even close to NeXTStep in features, and the cost was a lack of simplicity.

    Depends on what you're measuring. NT had (still has, comparing to OS X) better internals - SMP, fine-grained locking, etc, etc.

  • by Jeremi ( 14640 ) on Monday July 16, 2007 @01:16AM (#19873433) Homepage
    BeOS had a lot of problems as well, for instance the OS was written in C++, which meant that when you wrote drivers, they had to be in C++.


    This is incorrect -- kernel code under BeOS was written in C. It was possible to use C++ in BeOS kernel mode code if you knew what you were doing and what to avoid (e.g. exceptions) but it wasn't recommended.


    If you wanted to write a decent userland app in BeOS, OTOH, C++ was your only real choice.

  • by snuf23 ( 182335 ) on Monday July 16, 2007 @01:38AM (#19873529)
    The Amiga performed much better with at least 1MB of RAM. The upgrade to 512KB on the original Amiga 1000 was almost mandatory as a lot of applications required it. On the Amiga 500 the expansion to 1MB was very popular as something simple such as adding a second disk drive could use up a little memory and make programs wanting the 512KB not run.
  • by Carewolf ( 581105 ) on Monday July 16, 2007 @01:49AM (#19873575) Homepage

    KDE/Qt has that nice signal/slot thing, it must be easy to write that in a way that makes use of multi-cores.

    It is! In Qt4; it has transparent thread-safety across signals and slots, making it very easy to write multithreaded Qt4 applications. KDE is a little behind, but KDE4 is still going to be more multithreaded than KDE3.
  • Re:Ummm... (Score:1, Informative)

    by Anonymous Coward on Monday July 16, 2007 @02:10AM (#19873651)

    This has great performance advantages over processes, but you lose all of the advantages of protected virtual memory, hence the need for locks, mutexes, critical sections, etc. Threads are actually a step backward from a reliability/security standpoint.


    This is something of a confused summary. You make it sound as if constructs like locks are hacks to get around the lack of memory isolation in multi-thread applications. That's not true at all. Locks, mutexes, and other synchronization constructs are necessary to synchronize access to memory under all circumstances where multiple execution contexts (that is, multiple threads or multiple processes) share data. A multi-threaded application can be designed to avoid sharing memory just as much as a multi-process application can, and as a result, it won't need locks. Likewise, multi-process applications can share data (for instance, using POSIX shared memory), and when they do, they aren't off the hook for locking because they don't use threads.

    Also, your statement that "Threads are actually a step backward from a reliability/security standpoint," makes no sense to me. You might be conflating the difference between shared memory concurrency and other ways of writing concurrent programs with the difference between processes and threads. I'm sure many people argue that shared memory concurrency is unreliable and potentially insecure, but that's not because of threads.

    In fact, the difference between processes and threads is a subtle one. Neither term has a definitive meaning (they are not theoretical computer science constructs). The definition of a process and of a thread depends on what system you're talking about.
                    --Justin
  • by KAMiKAZOW ( 455500 ) <kamikazow@hotmail.com> on Monday July 16, 2007 @05:13AM (#19874329)
    Apple spoke about multithreading in last year's WWDC "Mac OS X State of the Union" session. Apple provided a recording of that session (among two others) for free though iTunes. Since they're free, I uploaded a short clip. Once Veoh encoded that video, it will be available at http://www.veoh.com/videos/v801272G85gFFER [veoh.com].
  • by man_of_mr_e ( 217855 ) on Monday July 16, 2007 @05:21AM (#19874357)
    There are many factors that define the performance of an OS. One of them is the number of features it provides, and another is the timetable in which said features are delivered. Yet another is legacy compatibility.

    BeOS was new. It didn't have to be compatible with anything. But give it 10 years, and 2 Gazillion hacks to let old software continue to work. Give it hundreds or thousands of features, many of which are probably no longer even used by many people, but still have to be there because some small subset needs them. Give it features built upon other features and security patches upon other patches.

    Commercial software vendors seldom have the ability to ship software when it's ready, they have to meet timelines. Look at OS X, each new release cycle takes longer and longer because as the OS matures, it takes more and more time to wade through the existing code to change it. It gets slower because more conditionals have to be added to check for compatibility or security issues, or because it needs to do more than it used to.

    Linux (the kernel), on the other hand, seems to get better and better, faster and faster, with each new release. There is a reason for that, though. No commercial pressure to release, they can set an arbitrary release date and simply ship whatever features are ready, and do so relatively frequently because they don't have to worry about a large and complete OS release, just the kernel.

    Distro vendors, on the other hand, seem to be taking longer and longer between releases (not counting Debian, which has always been glacial), because as the body of software grows, it takes more and more work to maintain it. Distro quality depends largely upon how long they spend stabilizing releases.
  • by CarpetShark ( 865376 ) on Monday July 16, 2007 @08:14AM (#19874933)
    Wrong. The very first Amiga was 256KB, the most popular varieties were 512k-16MB (averaging 1-2MB, probably).
  • by DusterBar ( 881355 ) on Monday July 16, 2007 @10:10AM (#19875839) Homepage

    From today's perspective (and even 10 years ago) the Amiga has many limitations. But lets not forget that the Amiga started over 20 years ago! (Boy, I must be getting old...)

    Multi-threaded programming was a core feature of the Amiga. The UI, Filesystem, core input management, sound, etc. All were managed via threads. This is what allowed some of the very smooth behaviors that so many still talk about today. (Albeit with some rose colored glasses)

    Yes, multi-threaded programming is hard for those who learned with BASIC on C64/Apple-II and MS-DOS environments. But that does not mean it is (or was) fundamentally hard. It just takes a slightly different mindset and approach.

    There are many times I had wished other platforms had good multi-threading. After leaving Commodore-Amiga, I actually built/designed something known as MMOS on top of which Scala technology then moved to. Multi-tasking/multi-threading makes some of the harder problems just so much easier to solve. (Especially in event-based or near-real-time systems)

    I am generally amazed at how many people have difficulty with the multi-threading concept. I was amazed back then and even more so now. One time, I worked with a 3rd party ISV to help them with some software design of a game for the Amiga. They ended up really "getting" the treading concept, so much so that they had to write their own threading OS layer on top of DOS in order to port the game to MS-DOS. (A hockey game where each computer player AI ran in its own thread and the display thread did the coordination of behaviors - it was a great game for its time).

    BTW - The entire AmigaOS software team could fit in a single van (and did a number of times when going out to events). (Ok, a large van, but still a van). Our whole team was less than 1/30th the size of the Apple OS team in the late 80's and an unimaginable amount less than the Microsoft Windows team. As far as slow/late software upgrades - the AmigaOS 2.0/2.04 software upgrade was a long time in coming as the target kept moving and we had this "99.99% compatible" requirement, even for software that was doing silly things like assuming certain values in undocumented OS data structures. Even so, the upgrade was only 16 months late relative to the initial target date, of which 6 months was trying to convince the marketing department that they should actually sell the upgrade. (They thought that the Amiga was not worth doing upgrades - users should buy new ones)

    -- ex-Commodore-Amiga OS Systems Engineer (Exec/Expansion/680x0/Audio/Layers/Workbench/IEEE/ etc.)

  • by ultranova ( 717540 ) on Monday July 16, 2007 @03:45PM (#19880041)

    The linux kernel beats the beos kernel in threading benchmarks, but the entire Be OS GUI stack (kernel, display, windowing, controls) were designed with multithreading in mind. X/KDE/GTK et al are relics based on 1986 era computing.

    As I've understood it, X is simply a protocol, and the X server itself could be single- or multithreaded. That the current ones aren't (?) is simply an implementation deficiency.

  • by Anonymous Coward on Monday July 16, 2007 @03:47PM (#19880063)
    The Archimedes put atari STs to shame, not amigas particularly. Archies were cooperative multitasking - processes had to yield the CPU, or they would starve other processes. Amigas had pre-emptive multitasking. While the Archie's default-CPU ARM processor was undoubtedly faster than the CPU of a default-CPU Amiga, Archies burnt much of their faster CPU's time on doing stuff the Amiga had secondary processors doing in the background.

  • by drinkypoo ( 153816 ) <drink@hyperlogos.org> on Monday July 16, 2007 @10:44PM (#19883629) Homepage Journal

    The Amiga had a 68000 processor in 1985. The classic hardware Amiga used could do things that PPC Mac users couldn't do and single core Intel/AMD systems couldn't do until not too long ago.

    The Amiga had a custom design that wouldn't scale. It needed new, custom hardware for each processor revision for the hardware to keep up with the processor. Eventually the Amiga got accelerated graphics cards and storage host adapters and the main system basically handled peripherals and sound.

    the Macs had a horrible lack of multitasking that the Amiga had, certain x86 operating systems at the time allowed multitasking, but were really bad at it.

    The Amiga was a microkernel-based system which worked efficiently because it had no memory protection. It was an explicitly single-user system (hacks came out eventually to provide multiuser functionality, permissions, etc etc, but without memory protection it's all just jerking off really) and while it is capable of performing modern tasks it has serious deficiencies. It was totally excellent for its purpose at the time, but it just isn't practical today (except perhaps for PDAs and such, where I'm surprised not to have seen it.)

    the more advanced Amiga hardware was far cheaper.

    It's too bad the company was sucked dry from within, and there was virtually no advertising.

  • Re:BeOS was awesome (Score:4, Informative)

    by drinkypoo ( 153816 ) <drink@hyperlogos.org> on Monday July 16, 2007 @11:43PM (#19884019) Homepage Journal

    Quit pretending that it was ever a viable OS or that it is anything special nowadays. Yeah, yeah, it could run multiple videos at once. But then again we're talking multiple 160x120 videos because that was about as good as video got at that time.

    Speaking of tech demos, the "book" demo where you put four quicktime movies on the pages of a book and flipped the pages with the mouse, did you ever see that? On a 66MHz BeBox (dual 603e, hardly a speed demon) you could have four 320x240 (biotch!) videos playing on this book. Well, you could only see two at first. But then you flip the page around as you like with the mouse and you can see (part of) four videos playing at once. And the whole thing was quite smooth. The framerate would sometimes degrade but the page still moved smoothly and the rest of the OS was still responsive.

    That was the one that really impressed me. They obviously really cared about responsiveness in a way that no one else seems to.

  • by drinkypoo ( 153816 ) <drink@hyperlogos.org> on Monday July 16, 2007 @11:50PM (#19884073) Homepage Journal
    Most Amiga 1000s I have seen had only 512kB, most 500s have had 1MB (the expansion had the realtime clock in it, too, sigh.) Most 2000s had 1MB, but lots had 2MB, after that all bets are off. A friend of mine had an A500 with 16MB (he hacked a Zorro II slot onto the side.)

All the simple programs have been written.

Working...