Loop now uses the clock's deadline method
This commit is contained in:
parent
bfa69a6db2
commit
bc60572c31
|
@ -5,7 +5,7 @@
|
||||||
<sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
|
<sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/venv" />
|
<excludeFolder url="file://$MODULE_DIR$/venv" />
|
||||||
</content>
|
</content>
|
||||||
<orderEntry type="inheritedJdk" />
|
<orderEntry type="jdk" jdkName="Python 3.11 (StructuredIO)" jdkType="Python SDK" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
</component>
|
</component>
|
||||||
</module>
|
</module>
|
|
@ -1,4 +1,4 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.10 (StructuredIO)" project-jdk-type="Python SDK" />
|
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.11 (StructuredIO)" project-jdk-type="Python SDK" />
|
||||||
</project>
|
</project>
|
|
@ -189,7 +189,7 @@ class FIFOKernel(BaseKernel):
|
||||||
self.suspend()
|
self.suspend()
|
||||||
if amount > 0:
|
if amount > 0:
|
||||||
self.event("before_sleep", self.current_task, amount)
|
self.event("before_sleep", self.current_task, amount)
|
||||||
self.current_task.next_deadline = self.current_task.paused_when + amount
|
self.current_task.next_deadline = self.clock.deadline(amount)
|
||||||
self.paused.put(self.current_task, amount)
|
self.paused.put(self.current_task, amount)
|
||||||
else:
|
else:
|
||||||
# If sleep is called with 0 as argument,
|
# If sleep is called with 0 as argument,
|
||||||
|
|
|
@ -34,6 +34,7 @@ async def main_3(data: bytes):
|
||||||
assert not await path.exists()
|
assert not await path.exists()
|
||||||
await aprint(f"[main] Done in {structio.clock() - t:.2f} seconds")
|
await aprint(f"[main] Done in {structio.clock() - t:.2f} seconds")
|
||||||
|
|
||||||
|
|
||||||
MB = 1048576
|
MB = 1048576
|
||||||
payload = b"a" * MB * 100
|
payload = b"a" * MB * 100
|
||||||
# Write 100MiB of data (too much?)
|
# Write 100MiB of data (too much?)
|
||||||
|
|
Loading…
Reference in New Issue