Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Implement the semaphore functions in sthread
[simgrid.git] / examples / sthread / pthread-producer-consumer.tesh
1 $ env ASAN_OPTIONS=verify_asan_link_order=0:$ASAN_OPTIONS LD_PRELOAD=${libdir:=.}/libsthread.so ./pthread-producer-consumer
2 > [0.000000] [sthread/INFO] Starting the simulation.
3 > Producer 1: Insert Item 0 at 0
4 > Producer 2: Insert Item 0 at 1
5 > Consumer 1: Remove Item 0 from 0
6 > Producer 1: Insert Item 1 at 2
7 > Consumer 2: Remove Item 0 from 1
8 > Producer 2: Insert Item 1 at 3
9 > Consumer 1: Remove Item 1 from 2
10 > Producer 1: Insert Item 2 at 0
11 > Consumer 2: Remove Item 1 from 3
12 > Producer 2: Insert Item 2 at 1
13 > Consumer 1: Remove Item 2 from 0
14 > Consumer 2: Remove Item 2 from 1
15 > [0.000000] [sthread/INFO] All threads exited. Terminating the simulation.