MCPcopy Create free account
hub / github.com/simplejson/simplejson / scenario_shared_encoder_shared_dict

Function scenario_shared_encoder_shared_dict

tsan_stress_simplejson.py:346–364  ·  view source on GitHub ↗

All threads encode the SAME dict -> encoder_listencode_dict crit-sect.

()

Source from the content-addressed store, hash-verified

344
345
346def scenario_shared_encoder_shared_dict():
347 """All threads encode the SAME dict -> encoder_listencode_dict crit-sect."""
348 encoder = _make_shared_encoder()
349 shared = SHARED_DICT
350
351 def worker():
352 deadline = time.monotonic() + DURATION
353 for _ in range(ITERATIONS):
354 try:
355 encoder(shared, 0)
356 except Exception:
357 pass
358 if time.monotonic() > deadline:
359 break
360
361 run_scenario(
362 "shared encoder + shared dict (encoder_listencode_dict CS)",
363 [worker],
364 )
365
366
367def scenario_shared_encoder_shared_list():

Callers

nothing calls this directly

Calls 2

_make_shared_encoderFunction · 0.85
run_scenarioFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…