Threading
-
Upload
melick-baranasooriya -
Category
Technology
-
view
1.500 -
download
2
Transcript of Threading
ThreadsMelick R. Baranasooriya
http://melick-rajee.blogspot.com/
ThreadO Operating systems
O separate the different applicationsO operating system allocates processor
time
O Thread maintainsO exception handlersO a scheduling priority
When to use ?O Rich user experienceO Divide the Work load
O Communicate overO networkO Web serverO database
When to use ? ..O Operations that take a large amount
of timeO Distinguish tasks
O high-priorityO manages time-critical tasksO low-priority thread
O May consume memory (< than few)
Simple Example
Thread Operations
Join()
Abort()Sleep()
Interrupt()
WaitOne()
Cross Thread Operations
O GUI is running in a separate threadO If we use threads
O It is running in separate Thread
Thread Safe OperationsO Lock
O MutexO Semaphore
O Limits the number of threads that can access a resource
O Monitor
Thank You!