Java_tutorial_Threads - Tutorial on Thread Programming in...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Tutorial on Thread Programming in Java Part I: Summary of the main functions of the programs dataRec - stimulate the data records in a database - dataRec: key_id (key of a record), value (value for this record), state (idle, read, write)- op_read() - atomic read operation- op_write() - atomic operation for this dataRec readTrans the thread to stimulate a read transaction writeTrans the thread to stimulate a write transaction ReadWriteTest - generate read / write transactions to access to the database Part II: Some Simple Questions about the Programs Draw a simple diagram to show the flow and relations of the programs How to create a thread? How to achieve mutual exclusion? How to make a thread to wait? How to wake up a waiting thread? How to make a thread to sleep for a specific period of time? When will the system terminate a thread? How to terminate a thread? Part III: Simple Enhancement Currently, the client program generates a sequence of read and write operations to access to the data items. You may modify the program such that a user inputs read and write operations to access to the data items. Each user may input several read/write operations accessing to different data items. Each user input is terminated with the character input several read/write operations accessing to different data items....
View Full Document

Page1 / 6

Java_tutorial_Threads - Tutorial on Thread Programming in...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online