Farid Zakaria

Archive 2 min read

uC++ and Shooting Yourself in the foot


This post comes from my original WordPress blog, written between 2009 and 2018. It is kept here verbatim as an archive — the formatting did not always survive the move, and I no longer agree with all of it.

Almost at midterms....
One of the most enjoyable courses this term have been my concurrency course CS343. In the class we are using uC++ (mico C++); which is an extension by the University of Waterloo to add high-level concurrency in an object oriented language. So far what we have covered is the ability for "Coroutines" to maintain a separate stack through execution. Using this feature we have been able to solve some interesting problems in novel ways.

Here is an example of some uC++ code. Every coroutine must have a main method which is executing upon calling the inherited Resume() function of every couroutine on the this object. Once inside main(), you can suspend() the coroutine and execution will then unwind back to the original caller. Further resumes() cause the coroutine to start from the same location where the suspend() had occurred ("partial coroutines").


#ifndef _Q2_
#define _Q2_ 1
#include <uC++.h>
_Coroutine StringLiteral
{
    public:
        enum status { CONT, MATCH, ERROR}; //possible status
    private:
        status stat; //current status of match
        char ch; //character passed by cocaller
        void main();
    public:
        StringLiteral();
        status next (char c);
}; //StringLiteral
//End of Q2.H
#endif

I am curious to see where the course leads us to in use of uC++. Would be perhaps even neater to learn some GPGPU "ultimate concurrency" in my opinion.

Shooting myself in the foot

Interviews have begun and I made the mistake of applying to 54 jobs. The result is that I now have tons of interviews. Sounds like a good thing? In theory perhaps; although I am finding myself short on time to complete assignments and my extra curricular activities. I will try and get a photo up soon of all the interviews I've had once they are complete.

Crossing my fingers

3 archived comments

anya 2009-10-14

I’d suggest for you to come down here and try to file 138492734 applications and get no response whatsoever :D

Ahhh, the US.

:P

calais 2009-11-15

you had me at ++

Farid Zakaria 2010-01-08

@Anya: You’re a model now though @Calais: lol :)