Skip to content

Commit 186d55f

Browse files
committed
Typos and table formatting
1 parent 73ccc67 commit 186d55f

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

src/task/blocking.rs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,13 @@ lazy_static! {
9696
// This value represents the trend of tasks mapped onto the thread pool.
9797
// Calculation is following:
9898
//
99-
// α :: EMA_COEFFICIENT :: smoothing factor between 0 and 1
100-
// Yt :: freq :: frequency sample at time t
101-
// St :: acc :: EMA at time t
99+
// +--------+-----------------+----------------------------------+
100+
// | Symbol | Identifier | Explanation |
101+
// +--------+-----------------+----------------------------------+
102+
// | α | EMA_COEFFICIENT | smoothing factor between 0 and 1 |
103+
// | Yt | freq | frequency sample at time t |
104+
// | St | acc | EMA at time t |
105+
// +--------+-----------------+----------------------------------+
102106
//
103107
// Under these definitions formula is following:
104108
// EMA = α * [ Yt + (1 - α)*Yt-1 + ((1 - α)^2)*Yt-2 + ((1 - α)^3)*Yt-3 ... ] + St
@@ -163,7 +167,7 @@ fn scale_pool() {
163167
{
164168
// Throughput is low. Allocate more threads to unblock flow.
165169
// If we fall to this case, scheduler is congested by longhauling tasks.
166-
// For unblock the flow we should add up some threads to the pool, but not that much to
170+
// For unblock the flow we should add up some threads to the pool, but not that many to
167171
// stagger the program's operation.
168172
let scale = LOW_WATERMARK * current_frequency + 1;
169173

@@ -221,8 +225,8 @@ fn create_blocking_thread() {
221225
match err.kind() {
222226
ErrorKind::WouldBlock => {
223227
// Maximum allowed threads per process is varying from system to system.
224-
// Some systems has it(like MacOS), some doesn't(Linux)
225-
// This case expected to not happen.
228+
// Also, some systems have it(like macOS), and some don't(Linux).
229+
// This case expected not to happen.
226230
// But when happened this shouldn't throw a panic.
227231
let current_arc = POOL_SIZE.clone();
228232
MAX_THREADS.store(*current_arc.lock().unwrap() - 1, Ordering::SeqCst);
@@ -235,7 +239,7 @@ fn create_blocking_thread() {
235239
});
236240
}
237241

238-
// Enqueues work, attempting to send to the threadpool in a
242+
// Enqueues work, attempting to send to the thread pool in a
239243
// nonblocking way and spinning up needed amount of threads
240244
// based on the previous statistics without relying on
241245
// if there is not a thread ready to accept the work or not.

0 commit comments

Comments
 (0)