Example of a multi-threaded MEX function, that can easily be adapted
Ahora está siguiendo esta publicación
- Verá actualizaciones en las notificaciones de contenido en seguimiento.
- Podrá recibir correos electrónicos, en función de las preferencias de comunicación que haya establecido.
Max_in_place is a sample MEX file that shows a generic framework for multi-threaded processing in MEX functions.
Syntax: max_in_place(matrix1, matrix2)
The 2 input matrices must be real non-sparse and have the same number of elements. The matrix1 input is updated in-place (without memory reallocation) with the maximal value of corresponding elements in the two matrices.
Multi-threading is controlled via Matlab's builtin maxNumCompThreads function.
The code can easily be adapted for other processing types.
A detailed description is found at: http://UndocumentedMatlab.com/blog/multi-threaded-mex
Citar como
Yair Altman (2026). max_in_place - example of multi-threaded MEX function (https://es.mathworks.com/matlabcentral/fileexchange/68237-max_in_place-example-of-multi-threaded-mex-function), MATLAB Central File Exchange. Recuperado .
Agradecimientos
Inspirado por: Viewer3D, Mex Multithreading
Inspiración para: Simpler MEX Multi-Threading w/ a Persistent Thread Pool, Multi-Threading w/ MEX: Adding Two Vectors
Información general
- Versión 1.0.4 (10,3 KB)
Compatibilidad con la versión de MATLAB
- Compatible con cualquier versión
Compatibilidad con las plataformas
- Windows
- macOS
- Linux
