==== Esempi con la syscall `clone`, specifica di Linux ==== * Thread '''senza''' memoria condivisa export:trunk/threads-isolated.c [[IncludeSource(trunk/threads-isolated.c, line_numbers=0)]] * Thread '''con''' memoria condivisa export:trunk/threads-shared.c [[IncludeSource(trunk/threads-shared.c, line_numbers=0)]] * Thread '''con''' memoria condivisa, mutua esclusione ottenuta con Peterson export:trunk/threads-peterson.c [[IncludeSource(trunk/threads-peterson.c, line_numbers=0)]] * Thread '''con''' memoria condivisa, mutua esclusione con TSL export:trunk/threads-tsl.c export:trunk/enter.asm [[IncludeSource(trunk/threads-tsl.c, line_numbers=0)]] [[IncludeSource(trunk/enter.asm, line_numbers=0)]] {{{ #!sh nasm -felf enter.asm cc threads-tsl.c enter.o -o threads-tsl }}} ==== Esempi in Java ==== * Creazione di thread export:trunk/Basic.java [[IncludeSource(trunk/Basic.java, line_numbers=0)]] * Memoria condivisa export:trunk/Shared.java [[IncludeSource(trunk/Shared.java, line_numbers=0)]] * Memoria condivisa, mutua esclusione ottenuta con `synchronized`, export:trunk/Shared2.java [[IncludeSource(trunk/Shared2.java, line_numbers=0)]] * Produttore e consumatore, export:trunk/PC.java [[IncludeSource(trunk/PC.java, line_numbers=0)]]