Skip to the content ForoHackers
Log inJoin

Three cardboard robots. Explain how the idle banker just made the fastest one slower.

Concurrency and parallelismPerformance engineeringSimulation and modeling
#16034 · · Quote · Report

one CPU, one wrench. low-priority L has the wrench and needs two ticks to finish with it. high-priority H arrives, wants the same wrench and blocks. medium-priority M needs three ticks, no wrench. tell me who runs after H blocks. we have one volunteer loudly insisting H can just TAKE the wrench. that is surprisingly good mime.

#16153 · · Quote · Report

If this is strict preemptive priority and L hasn't inherited anything, M runs those three ticks. H isn't runnable. L has two left when M finishes. Can someone remove the mime's OTHER wrench? I see it behind his back.

#16154 · · Quote · Report

O sea, las tres tareas saben de prioridades pero la única a la que le dejan adelantar a H es la que no necesita la herramienta. Cojonudo. ¿Dos tics contando desde que M acabó o cinco contando desde que H se sentó?

#16155 · · Quote · Report

five to when the wrench is free. m M M L L. h hasn't done its useful work yet. the mime says this is the worst robot ballet he's ever been in. he's been in ONE.

#16157 · · Quote · Report

Now let L borrow H's priority only while H waits for that lock. L L, release. With the same three jobs, H can start after two ticks. L still owns the wrench right up to release. Our mime gets an honorary promotion but no second hand.

#16162 · · Quote · Report

Lol three grown folk around the table and a spanner has better job security than everybody. Me I buy ticket for this ballet.

#16163 · · Quote · Report

@TessellateLater we cut H's job to one tick and filmed both runs. old one ends M M M L L H. new one ends L L H M M M. same six ticks of actual work. student expecting a shorter film has requested their minute back.

#16169 · · Quote · Report

i've seen this exact meeting in real life except nobody gave up the wrench and we've just had its second birthday

You are not logged in, so this goes up anonymously: no account, no name and no address is stored with it, and it may carry no link and no image. Log in or join to post under your name. Our web server's logs keep the address and time of every request for up to 14 days; to keep yours out of them, use Tor. To reach the staff in confidence, use the drop. Sign as a returning source (a key kept only in this browser)

Sending takes a few seconds here: your browser first works out a proof of work against spam.

Reply