@@ -531,37 +531,69 @@ fn socket_bridge_thread(
531531 } ;
532532
533533 loop {
534- let n = unwrap ! (
535- zmq:: poll( & mut poll_items, -1 ) ,
536- Err ( err) => {
537- debug_panic!( "While polling 0MQ items: {err:?}" ) ;
538- 0
539- }
540- ) ;
541-
542- for _ in 0 ..n {
543- if consume_outbound_notification ( ) {
544- forward_outbound ( ) ;
545- continue ;
546- }
547-
534+ // On Windows ARM, zmq::poll with a non-zero timeout blocks forever
535+ // and inproc notification sockets may not wake the poll at all.
536+ // Use a fully separate polling path that doesn't rely on ZMQ
537+ // readability reporting: non-blocking poll + unconditional drain
538+ // of all sources + short sleep when idle.
539+ #[ cfg( all( target_os = "windows" , target_arch = "aarch64" ) ) ]
540+ {
541+ // Drain outbound messages (IOPub, StdIn) unconditionally
542+ consume_outbound_notification ( ) ;
543+ forward_outbound ( ) ;
544+
545+ // Check inbound sockets with non-blocking poll
548546 if has_inbound ( & stdin_socket) {
549547 unwrap ! (
550548 forward_inbound( & stdin_socket, & stdin_inbound_tx) ,
551549 Err ( err) => debug_panic!( "While forwarding inbound message: {err:?}" )
552550 ) ;
553- continue ;
554551 }
555-
556552 if has_inbound ( & iopub_socket) {
557553 unwrap ! (
558554 forward_inbound_subscription( & iopub_socket, & iopub_inbound_tx) ,
559555 Err ( err) => debug_panic!( "While forwarding inbound message: {err:?}" )
560556 ) ;
561- continue ;
562557 }
563558
564- debug_panic ! ( "Could not find readable message" ) ;
559+ std:: thread:: sleep ( std:: time:: Duration :: from_millis ( 1 ) ) ;
560+ continue ;
561+ }
562+
563+ #[ cfg( not( all( target_os = "windows" , target_arch = "aarch64" ) ) ) ]
564+ {
565+ let n = unwrap ! (
566+ zmq:: poll( & mut poll_items, -1 ) ,
567+ Err ( err) => {
568+ debug_panic!( "While polling 0MQ items: {err:?}" ) ;
569+ 0
570+ }
571+ ) ;
572+
573+ for _ in 0 ..n {
574+ if consume_outbound_notification ( ) {
575+ forward_outbound ( ) ;
576+ continue ;
577+ }
578+
579+ if has_inbound ( & stdin_socket) {
580+ unwrap ! (
581+ forward_inbound( & stdin_socket, & stdin_inbound_tx) ,
582+ Err ( err) => debug_panic!( "While forwarding inbound message: {err:?}" )
583+ ) ;
584+ continue ;
585+ }
586+
587+ if has_inbound ( & iopub_socket) {
588+ unwrap ! (
589+ forward_inbound_subscription( & iopub_socket, & iopub_inbound_tx) ,
590+ Err ( err) => debug_panic!( "While forwarding inbound message: {err:?}" )
591+ ) ;
592+ continue ;
593+ }
594+
595+ debug_panic ! ( "Could not find readable message" ) ;
596+ }
565597 }
566598 }
567599}
0 commit comments