I am currently doing a online lottery project. There are ten numbers for each
lottery starting from 00-09 to 90-99. When user purchase 2 tickets for 00-09 and
2 tickets for 10-19 then the output may look like this 100000-09, 100100-09
(for 00-09) and 100010-19, 100110-19 (for 10-19). When user purchase tickets for
00-09 and 10-19 for the same lottery then the output will be like this:
"100000-09 100100-09 100010-19 100110-19". Output will be displayed on a messagebox
(1 messagebox for each lottery, i mean ten numbers(00-09 to 90-99) makes a
messagebox for each lottery). When user makes request for 5 lotteries, 5
messagebox should be displayed.
Now the problem is that when i input tickets for 00-09 of 5 lotteries then the
application is displaying 5 messagebox, but when i input tickets for 00-09, 10-19
of 5 lotteries then sometimes application displays 2 messageboxes, sometimes 1,
sometimes 3, sometimes 4. What is the problem with the code.
I just looked at that code and from what I saw, you might have too many threads spining up. All you need to do is spin of an extra thread and pass it a value then probably write a switch statement.