🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Darrin West Mon, 12 May 1986 22:45
Trouble with Tasks
#192
Author: Darrin West
Date: Mon, 12 May 1986 22:45
83 lines
2306 bytes
We have Release E - November 1984.  (this may be the problem).

Anyway, I've been trying for several days now to get a fairly
simple tasking system to work.

Very simple systems are fine (maybe).  eg: start one task from
main, doing some printing and delays.

However, when I try the following program, the constructor
for "dumb2" seems to be run twice.  After using "print(VERBOSE|CHAIN)"
I discovered that sometimes (I don't remember under which conditions)
the task or ready to run queues get fouled up too.

Notice that I am using a derived class for "dumb2".  When I change it
to a task class directly things seem to work better.

---

#include <task.h>

class dumb : public task{
public:
    dumb(char *);
};

dumb.dumb(char *n) : (n,0,0)
{
    printf("in dumb %s\n",n);
}


class dumb2 : public dumb{
public:
    dumb2(char *);
};

dumb2.dumb2(char *n) : (n)
{
    printf("in dumb2 %s\n",n);
    delay(1);
    printf("after delay in dumb2\n");
    resultis(5);
}

main()
{
    dumb2 *p;

    p = new dumb2("p");
    
    printf("back in main\n");
    thistask->delay(3);
    printf("after delay in main\n");
    printf("result %d\n",p->result());
}

---

This gives the following output:

in dumb p
in dumb2 p
in dumb2 p


***** task_error(11) schedule: running
thistask: task main (is thistask):
	this==29828 mode=DEDICATED alert=29700 next=29700 result=0
	stack: max=750 current=36 t_base=2147477784, t_frame=2147477748, t_size=0
run_chain:
task p (RUNNING):

---

Any help, including rude comments about misunderstanding the tasking system,
would be appreciated.  If there were fixes made to Release E that corrected
this problem a hint as to where to get them would also be helpful.

Darrin West
west@calgary.UUCP


It might be getting brighter OUTside.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads