0

Hi, I'm making a console application, text based game, and what I need to do is be able to do more than one thing at the same time. For example, I need to be able to make a timer that runs constantly, whilst the game is being played. I also need to be able to print stuff to the screen whilst constantly listening for user input. I heard I could do this with multithreading (which apparently is very complicated). Is there any other way to do this? If not, where should I start to learn about threads and multithreading (I have never used threads/anything like this before)?

2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by ben1996123
0

I heard I could do this with multithreading (which apparently is very complicated).

You heard correctly. While threading is conceptually very simple, the subtle and difficult to trace errors of shared data access makes it among the harder things that most programmers have to deal with.

Is there any other way to do this?

Not if your goal is to avoid the complexity of threads. Other methods of achieving concurrency are just as complicated.

If not, where should I start to learn about threads and multithreading (I have never used threads/anything like this before)?

Have you tried Google?

0

You heard correctly. While threading is conceptually very simple, the subtle and difficult to trace errors of shared data access makes it among the harder things that most programmers have to deal with.


Not if your goal is to avoid the complexity of threads. Other methods of achieving concurrency are just as complicated.


Have you tried Google?

Ok, I managed to get it working with the help of this website:

http://www.codeproject.com/KB/threads/MultithreadingTutorial.aspx

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.