Re: [MOO-talk] Reading active connections

0 views
Skip to first unread message

The Prometheus MOO

unread,
Sep 13, 2015, 1:31:30 PM9/13/15
to moo-...@googlegroups.com
Greetings!

This is an old topic, but I would really love the fork-suspend diff for
Stunt.

Thanks!
-- Con

Tim van Dijen

unread,
Sep 13, 2015, 2:12:55 PM9/13/15
to MOO-...@googlegroups.com
See attachment...
It's originally writen for LambdaMOO, so I suggest applying it manually..

Tim

Op 13-9-2015 om 19:31 schreef The Prometheus MOO:
sub-second_fork_suspend.diff

The Prometheus MOO

unread,
Sep 13, 2015, 2:37:03 PM9/13/15
to moo-...@googlegroups.com
Hey!
I already have that one, wasn't there another diff?

The tasks.c thinggy doesn't want to work. But, I will keep looking.

Thanks!
-- Con

Tim van Dijen

unread,
Sep 13, 2015, 2:46:37 PM9/13/15
to MOO-...@googlegroups.com
What's it complaining about then?

Op 13-9-2015 om 20:36 schreef The Prometheus MOO:

Tim van Dijen

unread,
Sep 13, 2015, 3:47:34 PM9/13/15
to MOO-...@googlegroups.com
Here, use the one attached to this mail..
I got in working in matter of seconds...

Op 13-9-2015 om 20:36 schreef The Prometheus MOO:
subsecond_fork_suspend-stunt.diff

The Prometheus MOO

unread,
Sep 13, 2015, 3:48:37 PM9/13/15
to moo-...@googlegroups.com
tasks.cc: In function ‘time_t get_start_time(task*)’:
tasks.cc:98:5: error: named return values are no longer supported
return t->kind == TASK_FORKED ? t->t.forked.start_tv :
t->t.suspended.start_tv
^
tasks.cc:107:23: error: ‘after_seconds’ was not declared in this scope
delta.tv_sec = floor(after_seconds);
^
tasks.cc:110:6: warning: statement has no effect [-Wunused-value]
when;
^
tasks.cc:111:1: warning: no return statement in function returning
non-void [-Wreturn-type]
}
^
tasks.cc: At global scope:
tasks.cc:114:1: error: expected unqualified-id before ‘}’ token
}
^
tasks.cc:114:1: error: expected declaration before ‘}’ token
<builtin>: recipe for target 'tasks.o' failed
make: *** [tasks.o] Error 1
make exited with status code 2

The tasks.cc file has something close to the beginning that i don't
understand. The part where the diff says:

#define GET_START_TIME(ttt) \
(ttt->kind == TASK_FORKED \
- ? ttt->t.forked.start_time \
- : ttt->t.suspended.start_time)
+ ? &ttt->t.forked.start_tv \
+ : &ttt->t.suspended.start_tv)
+
+
+static inline struct timeval
+double_to_start_tv(double after_seconds)
+{
+ struct timeval now, delta, when;
+
+ gettimeofday(&now, NULL);
+ delta.tv_sec = floor(after_seconds);
+ delta.tv_usec = 1000000. * (after_seconds - delta.tv_sec);
+ timeradd(&now, &delta, &when);
+ return when;
+}


static void

I don't fully realize as in how I should go with putting that part. The
values are different and I tried to change them to the new ones, well,
apparently it didn't want to work out.

The Prometheus MOO

unread,
Sep 13, 2015, 4:46:26 PM9/13/15
to moo-...@googlegroups.com
Nevermind, my mistake. It works. Thanks!
Reply all
Reply to author
Forward
0 new messages