Skip to content

Commit 36aaf37

Browse files
authored
Merge pull request #12 from zsummer/dev
lockfree & shm
2 parents 50bc860 + 26d6cc9 commit 36aaf37

35 files changed

+1662
-1626
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@
2929
# Compiled Dir
3030
build
3131
build-*
32+
.DS_Store
33+
.vs
34+
.vscode
35+
xcodes
3236

3337
# Executables
3438
*.exe

.travis.yml

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,20 @@ install:
2020

2121
before_script:
2222
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$TRAVIS_COMPILER" == "gcc" ]]; then ulimit -c unlimited -S; fi
23+
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sudo sysctl -w kern.sysv.shmmax=419430400; fi
24+
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sudo sysctl -w kern.sysv.shmall=419430400; fi
25+
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo sysctl -w kernel.shmmax=419430400; fi
26+
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo sysctl -w kernel.shmall=419430400; fi
27+
28+
- if [[ "$TRAVIS_OS_NAME" == "osx" || "$TRAVIS_OS_NAME" == "linux" ]]; then sysctl -a|grep shm; fi
29+
30+
- df -m
31+
- ipcs -m
32+
- ipcs -mt
33+
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ipcs -M; fi
34+
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ipcs -lm; fi
35+
- ulimit -a
36+
2337

2438
script:
2539
- cmake --version
@@ -38,12 +52,15 @@ script:
3852
- ./test_fast_debug
3953
- ./test_fast_default
4054
- ./test_fast_simple
55+
- ./test_coverage
4156
- ./test_channel_normal
4257
- ./stress_multi-thread-env_main_reboot
4358
- ./stress_multi-thread-env_concurrent_reboot 50000 >/dev/null 2>&1
4459
- cd ..
60+
4561
- find ./ -name "*.gc*"
4662
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$TRAVIS_COMPILER" == "gcc" ]]; then coveralls; else echo "$TRAVIS_OS_NAME $TRAVIS_COMPILER"; fi
63+
4764
- ls -la
4865

4966
- sh merge_header.sh
@@ -63,13 +80,28 @@ script:
6380

6481
- ./stress_multi-thread-env_concurrent_reboot >/dev/null 2>&1
6582
- ./stress_multi-thread-env_main_reboot
66-
- ./benchmark_multi-thread_dynamic_inc
67-
- ./benchmark_multi-thread_write_file
83+
- ./benchmark_multi-thread
84+
- ./benchmark_multi-thread_nofile
85+
- ./benchmark_multi-thread_sync
86+
- ./benchmark_multi-thread_sync_nofile
6887
- ./benchmark_serialize_integer
6988
- ./benchmark_sync_bat_write
7089
- ./benchmark_normal
7190
- ./benchmark_udp
7291
- ./benchmark_fast
92+
93+
- ipcs -m
94+
- ipcs -mt
95+
- ./test_shm
96+
- ipcs -m
97+
- ipcs -mt
98+
- ./test_shm
99+
- ipcs -m
100+
- ipcs -mt
101+
- ./benchmark_multi-thread_travis_shm
102+
- cd ..
103+
104+
73105
- find ./ -name "*.gc*"
74106
- cd ..
75107

CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ else()
101101
LINK_LIBRARIES(pthread m c)
102102
endif()
103103

104+
if(USE_SHM)
105+
ADD_DEFINITIONS(-DFN_LOG_USE_SHM=1)
106+
endif()
107+
104108
#输出
105109
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)
106110

@@ -119,7 +123,7 @@ FOREACH (FILE_NAME ${TEST_CPP})
119123
)
120124
ENDIF()
121125
MESSAGE("TEST " ${TEST_NAME} )
122-
endforeach()
126+
ENDFOREACH()
123127

124128

125129

0 commit comments

Comments
 (0)