LWN.net Logo

TeX is highly parallelizable

TeX is highly parallelizable

Posted Apr 28, 2008 16:29 UTC (Mon) by forthy (guest, #1525)
Parent article: Interview with Donald Knuth (InformIT)

Contrary to what Don Knuth thinks, TeX has a lot of inherent parallelism, at least the typesetting process (let's forget the compilation process of \def definitions - if this needs to speed up, precompiling and caching is sufficient; .sty files don't change that often).

First of all, TeX typesets paragraphs pretty isolated. Each paragraph can be typesetted independent from all others - in parallel. TeX tries several times to typeset a paragraph with different spacing - this can also happen in parallel; whoever is best wins.

What I agree with him is that the "pipe" abstraction for parallel processes is proably the best we have found so far. Verilog/VHDL (synchronous parallelism) is difficult, shared memory is easier to write but even more difficult to debug (asynchronous parallelism, race conditions, deadlock, livelock, etc.). The pipe abstraction however has been used successful even by simple shell script programmers.

The tape-sorting stuff probably is outdated, but if you look at how algorithms with pipes work, you end up with the same principles as with tapes: your input and your output are basically sequential. Maybe some of these algorithms can be reused for pipe-sorting.


(Log in to post comments)

TeX is highly parallelizable

Posted Apr 28, 2008 21:05 UTC (Mon) by jordanb (subscriber, #45668) [Link]

One thing that I think is missed here is that if you look at what the benefits of Moore's law
have gone to in the past, they've been split between making the *computer* more capable by
exploiting the increased power for more sophisticated tasks (like real-time video decoding)
and making *programming* the computer easier, by permitting programmers to write less
efficient programs in higher level languages.

Now hardware manufacturers are saying "we're going to produce chips where the only way to
exploit the benefits of the increased power is to adopt significantly more complex and
difficult programming models, and we're going to expect programmers to recode the applications
to do that." 

Well, so basically what they're saying is that they're not going to (be able to) continue to
make computers easier to program. That sounds like Moore's Law hitting a wall to me. Sure by
going massively parallel we could perhaps continue to reduce time to compute in those rare
situations where it's worth it to do so, but that's only half of the benefit we've
traditionally gotten from Moore's Law.

Instead of saying "rewrite your programs to take advantage of multiple cores" they could *not*
give us more cores and say "rewrite your programs to be more efficient with the hardware you
have," but that would be blatantly admitting that Moore's Law is dead.

Copyright © 2008, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds