Multithreading problem... can anyone solve?
Hi !
I am totally new to multithreading. I know some theories behind but I don't have actual coding experience. Can anyone solve the problem below?
Problem:
Write a program that will increment and display an unsigned integer (UINT) for every 100 milliseconds.
UINT must start from 0 then will be reset to 0 when the highest value that a UINT can have is reached.
The program will terminate when the user presses any key.
CONDITIONS:
1. Create a worker thread that will increment and display the integer.
2. When the user presses any key, the worker thread must be terminated, then the program exits.
Thanks!
Re: Multithreading problem... can anyone solve?
Quote:
Originally posted by jbp2004
Hi !
I am totally new to multithreading. I know some theories behind but I don't have actual coding experience. Can anyone solve the problem below?
Problem:
Write a program that will increment and display an unsigned integer (UINT) for every 100 milliseconds.
UINT must start from 0 then will be reset to 0 when the highest value that a UINT can have is reached.
The program will terminate when the user presses any key.
CONDITIONS:
1. Create a worker thread that will increment and display the integer.
2. When the user presses any key, the worker thread must be terminated, then the program exits.
Thanks!
search in this FAQ for Threads
Re: Multithreading problem... can anyone solve?
Nice work jbp2004 !
Glad you solved your own problem :)
Re: Multithreading problem... can anyone solve?
>> History : 2004-07-05 Created by jbp2004
If you solved this in July of last year, why are you asking the question now?
Arjay
Re: Multithreading problem... can anyone solve?
He's not. Look at the date of the post.
Re: Multithreading problem... can anyone solve?
Quote:
Originally Posted by JimG
He's not. Look at the date of the post.
Are you sure? The comments are dated for last year.
Code:
//=============================================================
// Project : DisplayUINT
// OS : Windows
// File : DisplayUINT.c
// Version : 1.0
// Description : A porgram that display value of a UINT variable
// starting from zero to maximum value of UINT
// When UINT_MAX is reached, value is set back to 0
// History : 2004-07-05 Created by jbp2004