mirror of
https://github.com/deepseek-ai/deepseek-harness.git
synced 2026-09-11 04:00:38 +00:00
docs(code-runtime-python): correct the ProtocolChannel serialization docstring
The class docstring still credited the GIL plus per-frame PIPE_BUF atomicity for serializing writes, which _write_lock's full-write loop already superseded. State the current contract (writers serialized by _write_lock around a full-write loop) and drop the double blank line under the binding-replies note heading.
This commit is contained in:
@@ -345,9 +345,12 @@ class ProtocolChannel:
|
||||
|
||||
Writes are unbuffered and go straight to the fd, so ``send_sync`` is safe
|
||||
from inside model code (which may run outside an asyncio task) and from
|
||||
background tasks alike. The single writer is serialized by CPython's GIL
|
||||
plus one os.write per frame (POSIX guarantees atomicity for writes below
|
||||
``PIPE_BUF``, and our frames are short JSON lines).
|
||||
background tasks alike. Concurrent writers are serialized by ``_write_lock``
|
||||
around a full-write loop (see ``send_sync``): ``os.write`` releases the GIL,
|
||||
a frame may exceed ``PIPE_BUF`` (logs up to ``maxLogBytes``, completions up
|
||||
to ``maxValueBytes``, uncapped ``call`` args), and one ``os.write`` may
|
||||
consume only part of a frame — so neither the GIL nor per-frame atomicity is
|
||||
relied on for framing.
|
||||
"""
|
||||
|
||||
def __init__(self, fd: int) -> None:
|
||||
|
||||
Reference in New Issue
Block a user