Changeset 4e39f51
- Timestamp:
- Sep 30, 2020, 5:44:53 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 038110a
- Parents:
- 29185fc
- Location:
- doc/theses/thierry_delisle_PhD/code/readQ_example
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/thierry_delisle_PhD/code/readQ_example/proto-gui/main.cpp
r29185fc r4e39f51 12 12 using thrdlib::thread_t; 13 13 14 15 extern __attribute__((aligned(128))) thread_local struct { 16 void * volatile this_thread; 17 void * volatile this_processor; 18 void * volatile this_stats; 19 20 struct { 21 volatile unsigned short disable_count; 22 volatile bool enabled; 23 volatile bool in_progress; 24 } preemption_state; 25 26 #if defined(__SIZEOF_INT128__) 27 __uint128_t rand_seed; 28 #else 29 uint64_t rand_seed; 30 #endif 31 struct { 32 uint64_t fwd_seed; 33 uint64_t bck_seed; 34 } ready_rng; 35 } kernelTLS __attribute__ ((tls_model ( "initial-exec" ))); 14 36 15 37 //-------------------- … … 182 204 nproduce = 60; 183 205 206 const char * framework; 207 184 208 for(;;) { 185 209 static struct option options[] = { … … 199 223 case -1: 200 224 /* paranoid */ assert(optind <= argc); 225 if( optind == argc ) { 226 std::cerr << "Must specify a framework" << std::endl; 227 goto usage; 228 229 } 230 framework = argv[optind]; 201 231 goto run; 202 232 case 'b': … … 231 261 std::cerr << opt << std::endl; 232 262 usage: 233 std::cerr << "Usage: " << argv[0] << " [options] " << std::endl;263 std::cerr << "Usage: " << argv[0] << " [options] framework" << std::endl; 234 264 std::cerr << std::endl; 235 265 std::cerr << " -b, --buff=COUNT Number of frames to buffer" << std::endl; … … 240 270 } 241 271 run: 272 assert( framework ); 242 273 243 274 frames.reset(new Frame[nframes]); … … 249 280 std::cout << "(Buffering " << nframes << ")" << std::endl; 250 281 251 thrdlib::init( "fibre", 2 );282 thrdlib::init( framework, 2 ); 252 283 253 284 thread_t stats = thrdlib::create( Stats ); -
doc/theses/thierry_delisle_PhD/code/readQ_example/thrdlib/Makefile
r29185fc r4e39f51 1 all: fibre.so pthread.so 1 all: fibre.so pthread.so cforall.so 2 2 3 3 clean: 4 4 rm -rf fibre.so pthread.so 5 5 6 CXXFLAGS=-Wall -Wextra -O3 -g -fpic -std=c++17 -pthread -ftls-model=initial-exec 7 6 8 pthread.so: pthread.cpp Makefile 7 $(CXX) -Wall -Wextra -O3 -g -shared -o ${@} -pthread -fpic${<}9 $(CXX) $(CXXFLAGS) -shared -o ${@} ${<} 8 10 9 11 fibre.so: fibre.cpp Makefile 10 $(CXX) -Wall -Wextra -O3 -g -shared -o ${@} -pthread -fpic ${<} -lfibre 12 $(CXX) $(CXXFLAGS) -shared -o ${@} ${<} -lfibre 13 14 CFAINC=${HOME}/local/include/cfa-dev 15 CFALIB=${HOME}/local/lib/cfa-dev/x64-debug 16 CFAFLAGS=-z execstack -I${CFAINC} -I${CFAINC}/concurrency -L${CFALIB} -Wl,-rpath,${CFALIB} 17 18 cforall.so: cforall.cpp Makefile 19 $(CXX) $(CXXFLAGS) $(CFAFLAGS) -shared -o ${@} ${<} -lcfathread -lcfa -ldl -lm -
doc/theses/thierry_delisle_PhD/code/readQ_example/thrdlib/thread.cpp
r29185fc r4e39f51 28 28 29 29 const char * error = dlerror(); 30 if ( error ) {30 if ( required && error ) { 31 31 std::cerr << "Fetching symbol '" << symbol << "' failed with error '" << error << "'\n"; 32 32 std::abort();
Note: See TracChangeset
for help on using the changeset viewer.