Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Testing Concurrent Software: Understanding Interleavings and Thread Scheduling, Exams of Programming Languages

An overview of testing concurrent software, focusing on multithreaded test cases and thread interleavings. It discusses how to define multithreaded test cases, run them with different interleavings, and control thread scheduling using the interleave.jar agent. The document also explains the concept of interleavings and their importance in exposing bugs in concurrent systems.

Typology: Exams

Pre 2010

Uploaded on 07/30/2009

koofers-user-hte
koofers-user-hte 🇺🇸

10 documents

1 / 11

Toggle sidebar

Related documents


Partial preview of the text

Download Testing Concurrent Software: Understanding Interleavings and Thread Scheduling and more Exams Programming Languages in PDF only on Docsity! Testing concurrent software Testing concurrent software • Discussed in chapter 14 of JCP; read it • Will give some other ideas here Running multithreaded test cases • TestFramework.runOnce( MultithreadedTestCase test) – Creates and runs the threads once, under control of JVM thread scheduler • TestFramework. run200Interleavings( MultithreadedTestCase test) – Creates and runs the threads 200 times, generating different thread interleavings How do you get manual thread interleavings? • Specific -javaagent:lib/interleave.jar as a VM argument – Inserts calls to a special ThreadController.yield() method – Wraps calls to monitorenter, monitorexit, wait and notify – Doesn’t understand util.concurrent classes yet Which interleavings • An interleaving is when the system can decide when thread to allow to go next • Each thread has a number – Starting at 0 • Each interleaving is named – E.g., 0001110 • Thread 0 takes 3 steps, then thread 1 takes 3 steps, then thread 0 takes one step Options • -javaagent:lib/interleave.jar=trace – Print trace msgs at each context switch • -javaagent:lib/interleave.jar=prefix=cmsc433.p4 – Only instrument classes starting with cmsc433.p4 • In general, options are separated by commas, and have optional values • -javaagent:lib/interleave.jar=trace,prefix=cmsc433.p4 This is beta • This whole setup is beta • I’m sure that one or more of you will do something that breaks it • Each submission will be retested at least twice, if results aren’t consistent we will investigate it.
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved