Blogs

Green Threads: The Task API

Now that I have pre-emptive task switching between green threads basically working, I need to figure out what the API to interact with them wants to look like. Additionally, I need to clean up this scheduler thing that I've mauled in order to make the API and terminology consistent.

Tail-call elimination and moving to github

My main goals this week have been getting a tail-call elimination optimization to work in NQP-rx and moving my GSoC project to an external repository to make it easier for other projects to use it. Both of these goals have been successful. You can find the tail-call elimination optimization here. My GSoC project can now be found on github or installed via Plumage with ./plumage install tree-optimizations.

Seven days of PIRATE and Tree::Pattern hacking

Last week, I generalized PAST::Pattern to Tree::Pattern. This week, I put that to use.

Green Threads and Sleeping

I've spent my Parrot time for the last week working on something I call Alarms. Alarms are like Timers, except instead of specifying a delay the user specifies when they want the Alarm to fire. This is a pretty simple concept. If the Scheduler did what I wanted, I'd be done long ago.

A report from the (NFG) front lines.

After taking some time off GSoC work to pay the parrot Upgrade Tax that plumage had accumulated in the months since 2.3 shipped, and watching the World Cup this hasn't been an awfully productive week, code-wise. However, there's been quite a bit of work and planing done anyway.

Generalization: Tree::Pattern, Tree::Transformer, and Tree::Walker

Earlier this summer, when I was considering what sort of interface would be best for the PAST pattern matching and transformation I've been building, Bacek suggested an XPath-like syntax. XPath is, nominally, a language for pattern matching on XML, but it is applicable to any tree-like data structure where each node may have both attributes and children. It's a general-purpose tree-matching language.

Cleaning up the Scheduler

In my work on Timers, I've concluded that the scheduler really is the right place for scheduling things (who would have guessed?). How the scheduler *should* work is described in pdd25. How the scheduler actually works is a bit different, and how I want the scheduler to work to implement green threads is a bit different from that...

A first optimization with PAST::Pattern, in detail

In my previous post, I described in tutorial form how to implement a very simple constant folding optimization for Integer addition. In this very brief post, I describe in greater detail how that optimization works.

A New Design for Timers

The next step in green threads is to make them preemptive: after one thread has run for a while, it needs to be stopped so a waiting thread can have a turn. Parrot has a mechanism for doing things after a set time called Timers which would be perfect for this. Unfortunately, they don't really work.

Progress, refactorings and tests.

Since my last post I haven't spent as much time as I'd like coding, since getting a win32 development environment setup was a bigger time sink than I expected, but I've still managed to stay pretty close to the schedule. The main feature for the next week, once I'm done with the charset-level stuff will be Iterators, which will finally enable NFG 'literals' in PIR source, for which I have added, failing, tests the past week.

Syndicate content