I've been using a new program called RetinaRelay[0] to use my 5k iMac as a second display for my M1 Macbook using an ethernet (or Thunderbolt for even better performance). Works brilliantly. It's definitely higher latency than a normal monitor (my ethernet connection is 45ms vs 5ms for a monitor) but it's not noticeable for coding and miles better than remote desktop or similar.
Cool, I suppose it doesn’t work with windows? To use a 5k iMac as monitor to my windows desktop?
I'm pretty sure it relies on Mac APIs like Metal and ScreenCaptureKit but it's worth reaching out to the developer. He was very responsive when I requested features, and it may be a lot easier to build a windows application that adheres to the protocol using agentic development.