h a l f b a k e r yWhat's a nice idea like yours doing in a place like this?
add, search, annotate, link, view, overview, recent, by name, random
news, help, about, links, report a problem
browse anonymously,
or get an account
and write.
register,
|
|
|
Parallel while/whilst statement
Wouldn't it be more efficient to download while installing? Or processing calculations while reading files? I'm using the word "while" to mean "whilst" | |
The computer should work out the rate and buffer sizes for each task.
Otherwise you need to write complicated error prone threaded code to handle this stuff and shift between buffers.
it could work by automatically doubling all the buffers and flipping between them quickly as they are emptied and
used up, a bit like TCP window sizes.
parallel whilst {
parallel while {
char buf[1024];
os.read("/bigfile", 1024, buf);
}
parallel while {
lines = split(buf, "\n");
}
parallel while {
do_expensive_calculation(lines);
}
}
Please log in.
If you're not logged in,
you can see what this page
looks like, but you will
not be able to add anything.
Destination URL.
E.g., https://www.coffee.com/
Description (displayed with the short name and URL.)
|
|
Threading is hard to get right. The threading should be hidden behind the easiness of the syntax. |
|
|
The problem with threading is data races and synchronization. |
|
|
Essentially with the proposed syntax, one of the two automatically created buffers shall be passed to the next thread in the thread pool, for its parallel processing and onto the next. |
|
|
The buffer shall be reloaded with content and then flipped to the next. |
|
| |