A Tango Fibers question and a functional programming anecdote.

Don Clugston dac at nospam.com.au
Sun Oct 28 00:25:21 PDT 2007


downs wrote:
> Here's a question to the tango devs.
> I've been developing my own stackthreads (Fibers basically) library for
> a while now, and finally got it working a few days ago.
> 
> Then we did some speed tests and discovered that it was about twice as
> slow as Tango's Fiber implementation.
> 
> This prompted me to dig into the Fibers sourcecode, where I discovered
> that Fibers doesn't backup ECX/EDX on context switch, and the FP
> registers only on windows.
> 
> Now I am confused.
> 
> Could a knowledgeable tango dev kindly shed light on this issue? Why
> isn't it necessary to save all registers on a context switch?
> 
> ----
> Now for the anecdote.
> Today, at five in the morning, I wrote what I believe to be the first
> purely functional D code with as little redundancy as possible in the
> language.
> 
>> ["Load ", "Prefetch ", "Prefetch "] /zip/ ([0, 1, 2] /map/ (&info
> /rfix/ currentComic /fix/ (&subtract!(int) /fix/ currentStrip))) /map/
> &concat!(string) /zip/ [&update, &prefetch /fix/ (currentStrip-1),
> &prefetch /fix/ (currentStrip-2)] /map/ &Pool.addTask;
> 
> So I looked at it, and for some _strange_ reason my eyes suddenly
> started bleeding heavily.
> That's when I knew I had overdone it on the templates again.
> :)

In my best Hercules Grytpype-Thynne voice:
"You silly, twisted boy."

http://www.thegoonshow.net/quotes.asp



More information about the Digitalmars-d mailing list