Commit 27486c3
Add free-threaded specialization for `UNPACK_SEQUENCE` opcode.
`UNPACK_SEQUENCE_TUPLE/UNPACK_SEQUENCE_TWO_TUPLE` are already thread safe since tuples are immutable.
`UNPACK_SEQUENCE_LIST` is not thread safe because of nature of lists (there is nothing preventing another thread from adding items to or removing them the list while the instruction is executing). To achieve thread safety we add a critical section to the implementation of `UNPACK_SEQUENCE_LIST`, especially around the parts where we check the size of the list and push items onto the stack.
---------
Co-authored-by: Matt Page <[email protected]>
Co-authored-by: mpage <[email protected]>
1 parent 5ba67af commit 27486c3
File tree
7 files changed
+103
-30
lines changed- Include/internal
- Lib/test
- Python
7 files changed
+103
-30
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1339 | 1339 | | |
1340 | 1340 | | |
1341 | 1341 | | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
1342 | 1373 | | |
1343 | 1374 | | |
1344 | 1375 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1381 | 1381 | | |
1382 | 1382 | | |
1383 | 1383 | | |
1384 | | - | |
| 1384 | + | |
1385 | 1385 | | |
1386 | 1386 | | |
1387 | 1387 | | |
1388 | 1388 | | |
1389 | 1389 | | |
1390 | 1390 | | |
1391 | 1391 | | |
1392 | | - | |
| 1392 | + | |
1393 | 1393 | | |
1394 | 1394 | | |
1395 | 1395 | | |
| |||
1429 | 1429 | | |
1430 | 1430 | | |
1431 | 1431 | | |
1432 | | - | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
1433 | 1442 | | |
1434 | 1443 | | |
1435 | 1444 | | |
1436 | 1445 | | |
1437 | 1446 | | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
1438 | 1450 | | |
1439 | 1451 | | |
1440 | 1452 | | |
| |||
2525 | 2537 | | |
2526 | 2538 | | |
2527 | 2539 | | |
2528 | | - | |
| 2540 | + | |
2529 | 2541 | | |
2530 | 2542 | | |
2531 | 2543 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2487 | 2487 | | |
2488 | 2488 | | |
2489 | 2489 | | |
2490 | | - | |
| 2490 | + | |
2491 | 2491 | | |
2492 | 2492 | | |
2493 | | - | |
2494 | 2493 | | |
2495 | 2494 | | |
2496 | 2495 | | |
2497 | | - | |
| 2496 | + | |
| 2497 | + | |
2498 | 2498 | | |
2499 | 2499 | | |
2500 | | - | |
2501 | | - | |
| 2500 | + | |
| 2501 | + | |
2502 | 2502 | | |
2503 | | - | |
2504 | | - | |
| 2503 | + | |
| 2504 | + | |
2505 | 2505 | | |
2506 | 2506 | | |
2507 | 2507 | | |
2508 | 2508 | | |
2509 | | - | |
| 2509 | + | |
| 2510 | + | |
2510 | 2511 | | |
2511 | | - | |
2512 | | - | |
| 2512 | + | |
| 2513 | + | |
2513 | 2514 | | |
2514 | 2515 | | |
2515 | | - | |
2516 | | - | |
2517 | | - | |
2518 | | - | |
2519 | | - | |
2520 | | - | |
2521 | | - | |
2522 | | - | |
| 2516 | + | |
2523 | 2517 | | |
2524 | 2518 | | |
2525 | 2519 | | |
| |||
0 commit comments