Week 25, 26 and 33

20.06.2016 – 24.06.2016,
27.06.2016 – 01.07.2016,
15.08.2016 – 19.08.2016.

Class A, B and C

Topic:

Programming

Preparation:

Find material on your own from week plans, curriculum or other sources.

 

Additional material for those who might want more material on threads:

·         Multithreaded Programming Using C# - CodeProject

·         Thread Class

·         Threading Objects and Features

·         Thread Pooling

·         Timer

·         Monitor

·         Interlocked

·         ReaderWriterLock

More about threads in C#:

·         http://www.albahari.com/threading/

Today’s plan:

The exercises are not translated into English; you will probably have to use Google Translate where necessary.
The tasks are to be solved independently, preferably with discussion and control in groups (make your own groups).

 

Plan your own schedule working on the exercises below:

 

Basics:
- Cs001.zip (classes, fields, properties, simple operations etc.)
- Basis_DatoOpgaver.htm (methods, selection, loops etc.)
- Basis_SeachAlgo.htm (loops, lists, search algorithms, unit tests)
- Basis_SortAlgo.htm (loops, lists, sorting algorithms, unit tests)

 

Basic thread exercises:
- Basis_ThreadOpgaver_1_6.htm (designing using threads and synchronization)
- Basis_ThreadOpgaverTermometer.htm (includes link to a video with a solution)
- Trådopgaver (7-8) (more complex producer/consumer, guarded suspension)

You can get help by looking at the solution if you are stuck completely, but use this opportunity wisely - try to solve the task first. If you watch the video with the solution, then try afterwards on your own again.

Løsning af trådopgave 7.1 P-HUS: Producer-Consumer & Guarded Suspention http://bjoerks.net/YouTube_ICO.gif

- Opgave 10 med øl-sodavand soteringsanlæg (more complex thread exercise using producer/consumer)

You may want to use elements from: TrådEksempel9_ProducerConsumer_Buffer

 

Additional material with examples of design:
Slides om tråde og synkronisering
Trådeksempel4 (thread method in separate class, more on threads, joining threads – shows synchronization mistake)
Trådeksempel5_Sync (synchronization, primitive without resource-monitor, shared data

The ”good solution” (regarding design): 
Trådeksempel10_TrådOgResourceMonitor (using thread class and resource-monitor – the good design

Learning-goals:

To get a better knowledge in the programming topics that are directly related to subjects on 3rd semester.

Other:

You cannot expect support from teachers in the period, but the students should organize and solve tasks on your own.