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
Go ahead. Stick a fork in it.

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,


   

Please log in.
Before you can vote, you need to register. Please log in or create an account.

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

[link]






       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
  
      
[annotate]
  


 

back: main index

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