Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Matthieu Dorier
codes
Commits
a5c9580c
Commit
a5c9580c
authored
Jul 07, 2014
by
mubarak
Browse files
Updating codes_local_latency to generate events with time stamp > g_tw_lookahead
parent
c68713b9
Changes
1
Hide whitespace changes
Inline
Side-by-side
codes/codes.h
View file @
a5c9580c
...
...
@@ -30,13 +30,17 @@ static inline tw_event * codes_event_new(
/* Modeled latency for communication between local software components and
* communication between daemons and hardware devices. Measured in
* nanoseconds.
* Modified Jul 7: We want to make sure that the event time stamp generated
is always greater than the default g_tw_lookahead value. Multiplying by 1.1
ensures that if tw_rand_exponential generates a zero time-stamped event, we
still have a timestamp that is greater than g_tw_lookahead.
*/
#define CODES_MEAN_LOCAL_LATENCY 0.01
static
inline
tw_stime
codes_local_latency
(
tw_lp
*
lp
)
{
tw_stime
tmp
;
tmp
=
tw_rand_exponential
(
lp
->
rng
,
CODES_MEAN_LOCAL_LATENCY
);
tmp
=
(
1
.
1
*
g_tw_lookahead
)
+
tw_rand_exponential
(
lp
->
rng
,
CODES_MEAN_LOCAL_LATENCY
);
return
(
tmp
);
}
...
...
@@ -47,7 +51,6 @@ static inline void codes_local_latency_reverse(tw_lp *lp)
return
;
}
#endif
/* CODES_H */
/*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment