4 Aug 2000 dancer   » (Journeyer)

Work

Welcome to Dancer's Vortex'O'Shite(tm): Diving through 50 pages of legalese that changes by the hour..AKA the new shareholders' agreement. There are some clauses I took objection to. Word is they are now fixed. Waiting and seeing, tomorrow.

Tomorrow all must be signed. If it's not DancerHappyMaking(tm) by then, I'll sell rather than sign.

Staggered out of the office this-evening, with 0 sanity points and no energy.

Whatever you may have heard about John Rex Milton Stuckey...I assure you: He's a changed plant. He's earned my respect, and that's not easy for someone from his background to do. He's doing a damn fine job under the circumstances (which are tough).

HR was supposed to schedule a personnel review for my Igor. They haven't got back to me, and the due week has passed. I'll do it myself tomorrow, and send them the results.

Beautiful sunsets off the office balcony.

...that's more than I've said about work for some time. Interesting.

Anything other than work

What, like I've done anything other than work? The Mummy on DVD. Worth it. Picked up Aliens (special edition) on DVD today. Will watch tomorrow.

C++ and pthreads

Nymia: A member function in C++ requires an implicit other argument, which is this. Without that, the member has no sense of which class instance it belongs to. Passing of this to member functions is an implicit departure from the C calling structure, and the threading system relies (more or less) on that structure. You can however call a regular C-convention function, that knows what member function you want to call, and pass it the pointer to the instance as an argument (which will have to be cast appropriately).

This is off the top of my head. Errors may be present:

extern	"C" void *call_member_foo(void *);

void *call_member_foo(void *instance) { // Icky cast TheClassType *i=(TheClassType *)instance;

// Call the foo member function on that. (i)->foo(); return 0; }

You can then start a thread on call_member_foo() passing it a pointer to the object whose member you want to call.

A cleaner method would be to pass a pointer to a struct that contains a pointer to the class to avoid messy casting.

There are all sorts of ways around this...studying how many OO libraries deal with non OO GUI's (like Windows) will show you many similar solutions. Or look at (I think) the ACE(?) signal handling library, which has similar limitations.

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!