Almost everyplace should be using gstate.now. This is set at the beginning
of the current loop, and it avoids the expense of a system function call,
and is within few milli seconds of being the same as now(). It also gives
all actions in the current loop the same timestamp.
jm7
"Richard
Haselgrove"
<r.haselgr...@bti To
nternet.com> "David Anderson"
Sent by: <[email protected]>, "BOINC
boinc_alpha-bounc Developers Mailing List"
[email protected] <[email protected]>,
du <[email protected]>
cc
04/22/2009 06:00 Subject
AM Re: [boinc_alpha] 6.6.20 and work
scheduling]
> static inline bool finished_time_slice(ACTIVE_TASK* atp) {
> double time_running = gstate.now - atp->run_interval_start_wall_time;
> bool running_beyond_sched_period = time_running >=
> gstate.global_prefs.cpu_scheduling_period();
> double time_since_checkpoint = gstate.now -
atp->checkpoint_wall_time;
> bool checkpointed_recently = time_since_checkpoint < 10;
> return (running_beyond_sched_period && checkpointed_recently);
> }
I looked at that code a while back, and wondered why it uses gstate.now
where other parts of the code use a simple 'now':
1087 atp->run_interval_start_wall_time = now;
1088 app_started = now;
_______________________________________________
boinc_alpha mailing list
[email protected]
http://lists.ssl.berkeley.edu/mailman/listinfo/boinc_alpha
To unsubscribe, visit the above URL and
(near bottom of page) enter your email address.
_______________________________________________
boinc_dev mailing list
[email protected]
http://lists.ssl.berkeley.edu/mailman/listinfo/boinc_dev
To unsubscribe, visit the above URL and
(near bottom of page) enter your email address.