Changeset bb58825
- Timestamp:
- Jan 14, 2021, 12:45:28 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:
- b0f6190a
- Parents:
- a00bc5b
- Location:
- libcfa/src/concurrency
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/io/setup.cfa
ra00bc5b rbb58825 314 314 } 315 315 316 extern void signal_block( int sig ); 317 extern void signal_unblock( int sig ); 318 316 319 static void __io_create( __io_data & this, const io_context_params & params_in ) { 317 320 // Step 1 : call to setup … … 430 433 431 434 // Step 4 : eventfd 432 int efd; 433 for() { 434 efd = eventfd(0, 0); 435 if (efd < 0) { 436 if (errno == EINTR) continue; 437 abort("KERNEL ERROR: IO_URING EVENTFD - %s\n", strerror(errno)); 438 } 439 break; 440 } 441 442 int ret; 443 for() { 444 ret = syscall( __NR_io_uring_register, fd, IORING_REGISTER_EVENTFD, &efd, 1); 445 if (ret < 0) { 446 if (errno == EINTR) continue; 447 abort("KERNEL ERROR: IO_URING EVENTFD REGISTER - %s\n", strerror(errno)); 448 } 449 break; 450 } 435 // io_uring_register is so f*cking slow on some machine that it 436 // will never succeed if preemption isn't hard blocked 437 signal_block( SIGUSR1 ); 438 439 int efd = eventfd(0, 0); 440 if (efd < 0) { 441 abort("KERNEL ERROR: IO_URING EVENTFD - %s\n", strerror(errno)); 442 } 443 444 int ret = syscall( __NR_io_uring_register, fd, IORING_REGISTER_EVENTFD, &efd, 1); 445 if (ret < 0) { 446 abort("KERNEL ERROR: IO_URING EVENTFD REGISTER - %s\n", strerror(errno)); 447 } 448 449 signal_unblock( SIGUSR1 ); 451 450 452 451 // some paranoid checks -
libcfa/src/concurrency/preemption.cfa
ra00bc5b rbb58825 394 394 395 395 // sigprocmask wrapper : unblock a single signal 396 static inlinevoid signal_unblock( int sig ) {396 void signal_unblock( int sig ) { 397 397 sigset_t mask; 398 398 sigemptyset( &mask ); … … 405 405 406 406 // sigprocmask wrapper : block a single signal 407 static inlinevoid signal_block( int sig ) {407 void signal_block( int sig ) { 408 408 sigset_t mask; 409 409 sigemptyset( &mask );
Note: See TracChangeset
for help on using the changeset viewer.