Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Implement SemaphoreImpl::acquire_async (timeouts are allowed)
[simgrid.git] / examples / c / synchro-semaphore / synchro-semaphore.tesh
1 #!/usr/bin/env tesh
2
3 p Testing synchronization with semaphores
4
5 $ ${bindir:=.}/c-synchro-semaphore ${platfdir}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
6 > [  0.000000] (0:maestro@) Semaphore initialized with capacity = 1
7 > [  0.000000] (1:Alice@Fafard) Acquire #1 (that is free)
8 > [  0.000000] (1:Alice@Fafard) Acquired #1
9 > [  0.900000] (2:Bob@Fafard) Acquire #1 (that is not free)
10 > [  1.000000] (1:Alice@Fafard) Releasing #2
11 > [  1.000000] (2:Bob@Fafard) Acquired #1
12 > [  1.000000] (1:Alice@Fafard) Released #2
13 > [  2.000000] (2:Bob@Fafard) Releasing #2
14 > [  2.000000] (2:Bob@Fafard) Released #2
15 > [  3.000000] (2:Bob@Fafard) Trying for 1 sec to acquire #3 (that is free)
16 > [  3.000000] (2:Bob@Fafard) Acquired #3
17 > [  4.000000] (1:Alice@Fafard) Trying for 1 sec to acquire #3 (that is not free)
18 > [  5.000000] (2:Bob@Fafard) Releasing #4
19 > [  5.000000] (1:Alice@Fafard) Timeout.. Try #3 for another second.
20 > [  5.000000] (2:Bob@Fafard) Released #4
21 > [  5.000000] (1:Alice@Fafard) Acquired #3
22 > [  7.000000] (2:Bob@Fafard) Trying for 1 sec to acquire #5 (that is not free)
23 > [  8.000000] (2:Bob@Fafard) Timeout.. Try #5 for another second.
24 > [  9.000000] (2:Bob@Fafard) Timeout.. Try #5 for another second.
25 > [ 10.000000] (1:Alice@Fafard) Releasing #4
26 > [ 10.000000] (2:Bob@Fafard) Timeout.. Try #5 for another second.
27 > [ 10.000000] (1:Alice@Fafard) Released #4
28 > [ 10.000000] (2:Bob@Fafard) Acquired #5
29 > [ 10.000000] (2:Bob@Fafard) Releasing #6
30 > [ 10.000000] (2:Bob@Fafard) Released #6
31 > [ 10.000000] (2:Bob@Fafard) Trying for 1 sec to acquire #7 (that is free)
32 > [ 10.000000] (2:Bob@Fafard) Acquired #7
33 > [ 11.000000] (1:Alice@Fafard) Trying for 1 sec to acquire #5 (that is not free)
34 > [ 12.000000] (1:Alice@Fafard) Timeout.. Try #5 for another second.
35 > [ 13.000000] (1:Alice@Fafard) Timeout.. Try #5 for another second.
36 > [ 14.000000] (1:Alice@Fafard) Timeout.. Try #5 for another second.
37 > [ 15.000000] (2:Bob@Fafard) Releasing #8
38 > [ 15.000000] (1:Alice@Fafard) Timeout.. Try #5 for another second.
39 > [ 15.000000] (2:Bob@Fafard) Released #8
40 > [ 15.000000] (1:Alice@Fafard) Acquired #5
41 > [ 17.000000] (1:Alice@Fafard) Releasing #6
42 > [ 17.000000] (1:Alice@Fafard) Released #6
43 > [ 22.000000] (1:Alice@Fafard) Trying for 1 sec to acquire #7 (that is free)
44 > [ 22.000000] (1:Alice@Fafard) Acquired #7
45 > [ 22.000000] (1:Alice@Fafard) Releasing #8
46 > [ 22.000000] (1:Alice@Fafard) Released #8
47 > [ 65.000000] (2:Bob@Fafard) Done
48 > [ 72.000000] (1:Alice@Fafard) Done
49 > [ 72.000000] (0:maestro@) Finished