Skip to content

Instantly share code, notes, and snippets.

View xaliphostes's full-sized avatar
🏠
Working from home

Xaliphostes xaliphostes

🏠
Working from home
View GitHub Profile
@xaliphostes
xaliphostes / README.md
Last active February 7, 2024 08:53
Emscripten pthread lib in web worker

A small multi-threaded C++ library (so, does not include any main) compiled with emscripten and pthread running under the main thread in the browser, a web worker or using node.js.

Note: Emscripten will produce lib.js.

Using a web browser

Running this lib in the main thread is fine but, obviously, block the main thread. Running it using a web worker leads no error with modification of the worker script (see below)

Using node.js

Run fine except that it prevents Node app from ever exiting.

@xaliphostes
xaliphostes / Command args.cpp
Last active October 14, 2022 06:38
https://repl.it/CYSv/30 created by xaliphostes
/**
* ------------------------------------------------------------
* Show how convenient it is to use classes instead of a bunch
* of C functions.
*
* Part of the OOP course for PhD students and Researchers.
*
* Contact: fmaerten@gmail.com
* ------------------------------------------------------------
*/