.. _lab_matrix: Lab - Multithreaded Programming - Matrix Multiplication ======================================================= * Based on the documentation and sample code in :ref:`programming`, write a multi-threaded application to multiply two matrices. * The product :math:`$C$` of matrices :math:`$A$` (M rows and K columns) and :math:`$B$` (K rows and N columns) is a matrix of M rows and N columns. .. math:: C = A \times B The individual values of :math:`$C_{i,j}$` are calculated as: .. math:: C_{i,j} = \sum_{n=1}^{K} A_{i,n} \times B_{n,j} * Define matrices A, B and C as global two dimensional arrays or lists (for Python). * Create a tread to calculate each term of C. For safety, use a simple locking mechanism to control each thread writing to the global array, C. * Submit a short lab report as a plain text file explaining what you did in the activity and what you learned from doing it. Include your source code in your assignment submission. * `K-State Online Multi-threaded Application Submission Page `_