LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
fj_synch_delay.m
1%{ @file fj_synch_delay.m
2 % @brief Synchronization delay S_2(rho) for two-way Fork-Join
3 %
4 % @author LINE Development Team
5%}
6
7%{
8 % @brief Synchronization delay S_2(rho) for two-way Fork-Join
9 %
10 % @details
11 % Computes the mean synchronization delay for a 2-way Fork-Join
12 % queueing system. This is the average time tasks spend waiting
13 % at synchronization queues for their siblings to complete.
14 %
15 % S_2(rho) = (1/2) * (1 - rho/4) * R(rho)
16 %
17 % The F/J response time decomposes as:
18 % R_2^{F/J}(rho) = R(rho) + S_2(rho)
19 %
20 % where R(rho) is the delay at the server (M/M/1 response time).
21 %
22 % @par Syntax:
23 % @code
24 % S = fj_synch_delay(lambda, mu)
25 % @endcode
26 %
27 % @par Parameters:
28 % <table>
29 % <tr><th>Name<th>Description
30 % <tr><td>lambda<td>Arrival rate
31 % <tr><td>mu<td>Service rate (mu > lambda for stability)
32 % </table>
33 %
34 % @par Returns:
35 % <table>
36 % <tr><th>Name<th>Description
37 % <tr><td>S<td>Mean synchronization delay S_2(rho)
38 % </table>
39 %
40 % @par Reference:
41 % A. Thomasian, "Analysis of Fork/Join and Related Queueing Systems",
42 % ACM Computing Surveys, Vol. 47, No. 2, Article 17, July 2014.
43 % Eq. (8) on page 17:11.
44%}
45function S = fj_synch_delay(lambda, mu)
46
47% Compute utilization
48rho = lambda / mu;
49
50if rho >= 1
51 line_error(mfilename, 'System is unstable: rho = lambda/mu = %.4f >= 1. Require lambda < mu.', rho);
52end
53
54% Compute M/M/1 mean response time
55R_rho = qsys_mm1(lambda, mu);
56
57% Synchronization delay (Eq. 8): S_2(rho) = (1/2) * (1 - rho/4) * R(rho)
58S = 0.5 * (1 - rho / 4) * R_rho;
59
60end