Files
progcode/docs/design-system/concept-v3/visuals/v2/vibed-fiber-io.svg
huncode 12562baeb5
Build and deploy / deploy (push) Successful in 2m39s
Implement ProgCode identity and real shared reading UI kit
2026-10-27 15:19:49 +03:00

1 line
4.8 KiB
XML

<svg xmlns="http://www.w3.org/2000/svg" width="640" height="1100" viewBox="0 0 640 1100" role="img" aria-labelledby="title desc"><title id="title">Как fiber ждёт ввод-вывод в vibe.d</title><desc id="desc">На одном потоке fiber A уступает управление при ожидании read. Цикл событий запускает fiber B, а после готовности ввода-вывода возвращает управление fiber A.</desc><defs><marker id="arrow" markerWidth="9" markerHeight="9" refX="7" refY="4" orient="auto"><path d="M0 0 8 4 0 8" fill="none" stroke="#b64d26" stroke-width="1.6"/></marker><pattern id="hatch" width="9" height="9" patternUnits="userSpaceOnUse"><path d="M-2 2 2-2 M0 9 9 0 M7 11 11 7" stroke="#d8d0c0" stroke-width="2"/></pattern></defs><rect width="640" height="1100" rx="4" fill="#fbf8f1"/><g font-family="Arial,Helvetica,sans-serif" fill="#242824"><text x="32" y="44" font-size="20" font-weight="bold" fill="#b64d26" text-anchor="start" font-family="monospace">05 / VIBE.D</text><text x="32" y="87" font-size="33" font-weight="bold" fill="#242824" text-anchor="start">Ожидание без простоя потока</text><text x="32" y="122" font-size="24" font-weight="normal" fill="#676961" text-anchor="start">Один поток, несколько кооперативных задач.</text><path d="M32 148 H608" fill="none" stroke="#d8d0c0" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/><text x="48" y="192" font-size="23" font-weight="bold" fill="#b64d26" text-anchor="start">FIBER A</text><text x="366" y="192" font-size="23" font-weight="bold" fill="#b64d26" text-anchor="start">FIBER B</text><path d="M160 235 V678" fill="none" stroke="#d8d0c0" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/><path d="M478 235 V678" fill="none" stroke="#d8d0c0" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/><rect x="32" y="224" width="256" height="94" rx="10" fill="white" stroke="#d8d0c0" stroke-width="2"/><text x="52" y="260" font-size="25" font-weight="bold" fill="#242824" text-anchor="start">Читаем запрос</text><text x="52" y="297" font-size="25" font-weight="normal" fill="#327057" text-anchor="start" font-family="monospace">read()</text><path d="M160 319 V363" fill="none" stroke="#b64d26" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#arrow)"/><rect x="32" y="387" width="256" height="105" rx="10" fill="#efe9dd" stroke="#d8d0c0" stroke-width="2"/><text x="52" y="426" font-size="25" font-weight="bold" fill="#242824" text-anchor="start">Ожидание I/O</text><text x="52" y="465" font-size="24" font-weight="normal" fill="#676961" text-anchor="start">уступить поток</text><path d="M289 440 H457 V492" fill="none" stroke="#b64d26" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#arrow)"/><text x="371" y="420" font-size="21" font-weight="normal" fill="#676961" text-anchor="middle">переключение</text><rect x="350" y="516" width="258" height="103" rx="10" fill="#242824" stroke="#242824" stroke-width="2"/><text x="370" y="554" font-size="25" font-weight="bold" fill="#fbf8f1" text-anchor="start">Другая задача</text><text x="370" y="591" font-size="24" font-weight="normal" fill="#d8d0c0" text-anchor="start">выполняет код</text><path d="M478 620 V668 H310 V725" fill="none" stroke="#b64d26" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#arrow)"/><rect x="32" y="748" width="576" height="101" rx="10" fill="#efe9dd" stroke="#242824" stroke-width="2"/><circle cx="77" cy="797" r="20" fill="#fbf8f1" stroke="#b64d26" stroke-width="2"/><path d="M69 797 l6 6 12-15" fill="none" stroke="#b64d26" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/><text x="114" y="790" font-size="25" font-weight="bold" fill="#242824" text-anchor="start">Цикл событий: I/O готово</text><text x="114" y="827" font-size="24" font-weight="normal" fill="#676961" text-anchor="start">Fiber A можно возобновить</text><path d="M160 850 V893" fill="none" stroke="#b64d26" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#arrow)"/><rect x="32" y="916" width="576" height="83" rx="10" fill="white" stroke="#d8d0c0" stroke-width="2"/><text x="52" y="950" font-size="26" font-weight="bold" fill="#242824" text-anchor="start">Fiber A продолжает после read()</text><text x="52" y="984" font-size="24" font-weight="normal" fill="#676961" text-anchor="start">с сохранённым стеком и состоянием</text><text x="32" y="1055" font-size="22" font-weight="normal" fill="#b64d26" text-anchor="start">Долгий CPU-цикл без уступки задержит другие fibers.</text></g></svg>