Skip to content

Latest commit

 

History

History
17 lines (16 loc) · 929 Bytes

File metadata and controls

17 lines (16 loc) · 929 Bytes

MatrixExample

Простая рабочая (ещё нет) имплементация примера использования конкурентности из бумаги "Google Go!" 2010 года за авторством Martin Aigner и Alexander Baumgartner (мне лень имена переводить), на которую я наткнулся луркая по cat-v.org. Сам пример на странице 23 выглядел вот так:

func InverseProduct (a Matrix, b Matrix) {
    a_inv_future := InverseFuture(a);
    b_inv_future := InverseFuture(b);
    a_inv := <a_inv_future;
    b_inv := <b_inv_future;
    return Product(a_inv, b_inv);
}
func InverseFuture (a Matrix) {
    future := make (chan Matrix);
    go func () { future <Inverse(a) }();
    return future;
}