Have to document this before I forget it.
By passing the address of the object (this), the member function running on its own thread can reference the other members by creating a pointer to the class and casting the void* to a class*. For example:
void looper::run(void)
{
...
retval = thread_create(&id,NULL,&looper::loop, (void*) this);
...
}
...
void* looper::loop(void* data)
{
...
looper * ploop = (looper *) data;
...
}
With that, I think I am set to start hammering the design document.
Work: 4:05PM
Just found an interesting item. It seems that Amiga is on to something, I'll have to check this out.
Work: 2:30PM
Have been tracking down the people who wrote the code that
I will be modifying. Asked them a couple of questions 'bout
what will happen if I do this and that and other sorts of
stuff.
Work: 12:10PM
Still not convinced, I went to the designer and picked his
brain a little more and found out I overestimated the work
just a little bit. Now I'm back in the cube and really sure
what he really wants. In this work/business, everything and
everybody has gotta be in synch in order to make it work
the first time.
Work: 11:15AM
Just noticed in the spec a module will have to be modified.
So I went to the person who made the module, sat down for
30 to 45 minutes and talked 'bout the implications of the
spec. We managed to find a way on how the modification will
be performed and at the end of the short meeting, finally
agreed where the modifications will take place. Now I'm
back at my cube and will now perform the invasive surgery
of adding a new feature to the code.
10:00 AM
Been lookin' at the things I want to do and so far
everythings workin' out fine. It looks like everything I
need to know seems to be in place and at this point it's
just a matter of putting the design down in document form
and start bangin' and diggin' code after that. What I'm
thinking is using the object modeler from Microsoft
Enterprise edition to document the API. I'm thinking of
using the term "kit" instead of module or API.
There are two or three possible ways this would go when I'm
done with the kit, one is creating a kit about graphics
stuff. That would be the application, window, view, etc.
And all that GUI stuff which I'm already familiar with. For
me, there's just too many GUI toolkits out there that it's
just a waste of effort to try and make another GUI toolkit,
but, I dunno, it depends, if the existing GUI APIs have
good multithreading support then I'll use it. The second
one would be a set of tools for threaded objects, a thread
development toolkit would be the other way. The third is
basically build a kit about sockets, mail, etc.
At this point, the urge to code is so great that it's like
I'm on top of a giant wave. But, I'll just keep on
designing and documenting, gotta hold on until I get the
design in place. So far, the classes I made are already
helping me make my work a lot easier. Pretty darn nice
isn't it?
Work:
Got a very good spec from the designer plus some pick-your-
brain stuff. The designer is very good and I must say he
definitely knows what he wants. I'll just dig the code and
submit for approval, then that's it for the day. So far,
everything is going smooth at work, I know what they want
and they seem to get what they want from my work. I think
that's a very easy thing to do.
