<div dir="ltr">Or Jon.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Apr 17, 2019 at 12:41 AM Tomas Rokicki <<a href="mailto:rokicki@gmail.com">rokicki@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Use the source, Luke.  I mean Joseph.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 16, 2019 at 11:13 PM Joseph Wright <<a href="mailto:joseph.wright@morningstar2.co.uk" target="_blank">joseph.wright@morningstar2.co.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 17/04/2019 04:25, Jon Forrest wrote:<br>
> I'm trying to understand TeX internals.<br>
> <br>
> One thing I haven't found a definitive explanation of is whether the<br>
> input processor tokenizes the entire input file before the execution<br>
> processor gets the token list. TexbyTopic says "... all [processor]<br>
> levels are simultaneously  active, and there is interaction between<br>
> them.". Given the primitive  computing environment TeX was developed in,<br>
> it's hard to imagine how the  4 processors could run simultaneously. As<br>
> far as I can see, TeX has no multi-threading ability so it would be up<br>
> to TeX to "process" switch.<br>
> <br>
> So, how and why do the processors run simultaneously? How much of the<br>
> input file gets tokenized before the token list is handed to the<br>
> expansion processor?<br>
> <br>
> I wonder if Knuth were writing TeX today would he use multi-threading?<br>
> <br>
> Cordially,<br>
> Jon Forrest<br>
> <br>
<br>
TeX tokenizes one item at a time. That's seen of course in the fact that <br>
one can change catcodes during a document<br>
<br>
     \catcode`~=13 %<br>
     \def~{Hello}%<br>
     \catcode`~=12 %<br>
     ~ world<br>
     \bye<br>
<br>
As such, the different stages of TeX processing cannot be run in parallel.<br>
<br>
Joseph<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail-m_7450737571635640338gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>--  <a href="http://cube20.org/" target="_blank">http://cube20.org/</a>  --  <a href="http://golly.sf.net/" target="_blank">http://golly.sf.net/</a>  --</div></div></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>--  <a href="http://cube20.org/" target="_blank">http://cube20.org/</a>  --  <a href="http://golly.sf.net/" target="_blank">http://golly.sf.net/</a>  --</div></div></div></div></div>