HackerTrans
TopNewTrendsCommentsPastAskShowJobs

clavigne

no profile record

comments

clavigne
·vorig jaar·discuss
> However, when an entire program consists of a single chain of dependent instructions, which may happen e.g. when computing certain kinds of hash functions over a file, you are doomed. There is no way to increase the performance of that program.

Even in that case, you would probably benefit from having many cores because the user is probably running other things on the same machine, or the program is running on a runtime with eg garbage collector threads etc. I’d venture it’s quite rare that the entire machine is waiting on a single sequential task!
clavigne
·2 jaar geleden·discuss
The Nissan versa is like the last cheap car.

The Chevy Spark is dead.

The Mitsubishi Mirage is dead.

etc.
clavigne
·2 jaar geleden·discuss
Car thieves have been using antennas to remotely trigger the keyless entry to great success here in Canada. Many people leave their keys on their doors so you just need to put a range extender against the door and scan cars in front until one of them opens.
clavigne
·3 jaar geleden·discuss
> I'm not talking about whether the scheduler can block the task on IO. This is trivial.

The whole point of coroutines is that they are trivial to block and resume, right? So the way to deal with limited resources... is to block on them.

So when you need a connection, you await until one from the pool becomes available. From the point of view of the consumer it's very natural because grabbing a connection is just a standard async call, and returning it to the pool can be done the same way you would usually close it. If anything, it's a lot easier to manage them like this because unlike in a non async program you don't have to worry too much about blocking progress.
clavigne
·3 jaar geleden·discuss
We use it at work to send FSMs over the network for distributing tasks. Admittedly we always do this with continuations that haven't started yet, but there is no technical reason we couldn't serialize the already started ones (although you'd have to make sure you also send the coroutines you are currently awaiting on.)
clavigne
·3 jaar geleden·discuss
Scala async coroutines build FSMs that are just standard objects. They aren't very commonly used, but the same approach could probably be adapted to C.

Basically the compiler compiles async function to a very simple FSM object where each assignment to a local variable that lives longer than a yield point becomes a member of the FSM object. This is done after the transformation to a simple normal form, at which point the function basically looks like bytecode. The compiler generate a new class for every async coroutines.

The generated FSM classes are statically sized so they could in principle be stack allocated, and their instances can be manipulated like any other JVM object.

At $work we have a system using scala async that has all of these features (arrays of FSMs, serialization, distribution by sending to network etc.) Of course there are complications (file handles for example) and it's easier with a GC.