Half a croissant, on a plate, with a sign in front of it saying '50c'
h a l f b a k e r y
Get half a life.

idea: add, search, annotate, link, view, overview, recent, by name, random

meta: news, help, about, links, report a problem

account: browse anonymously, or get an account and write.

user:
pass:
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"
 
(0)
  [vote for,
against]

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);

} }

chronological, Jul 30 2022

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.
Short name, e.g., Bob's Coffee
Destination URL. E.g., https://www.coffee.com/
Description (displayed with the short name and URL.)






       Both.   

       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.
chronological, Jul 30 2022
  


 

back: main index

business  computer  culture  fashion  food  halfbakery  home  other  product  public  science  sport  vehicle