![]() |
|
#1
|
|||
|
|||
Multithreading, functors, my head hurts... Please help?We have been given the following assignment to do:
Quote:
So I have started, I can create suspended threads, suspend and resume them, terminate them, I think I have cleaned up my resources as well. When it comes to using functors, I have no idea what I am doing, I don't understand what they are or how to use them. This is the same with deep copying. Below is the code I have written so far. main.cpp CPP / C++ / C Code:
thread.h CPP / C++ / C Code:
If anyone can help me out, it would be much appreciated. Especially if they can explain functors and deep copying to me as well. If you can see anything silly I am doing in the code I have written so far, again, please explain what I have done wrong, and what I should be doing so I know for the future. Thanks in advance, Rob |
|||
|
#2
|
|||
|
|||
Re: Multithreading, functors, my head hurts... Please help?Hi Rob.
First that comes to my mind from deep copying is copying an object(class instance) and its member objects. In Java referred to cloning. Shallow copy copies current object creating new class instance and copies pointers/references to member objects not creating new instances. So the copied object and original object points to the same instances of the member classes. This does not include primitive types as they are in object memory space. Deep copy copies current object creating new class instance and copies member objects creating new instances of them and giving pointers/references to them to the copied object. So the copied object and original object points to different instances of the member classes. Hope this helps and please correct me if I'm wrong. As to funtors(function pointers?) I can't help you. J-M |
|
#3
|
|||
|
|||
Re: Multithreading, functors, my head hurts... Please help?Found a function pointers tutorial on this forum:
http://www.gidforums.com/t-5466.html |
|
#4
|
||||
|
||||
Re: Multithreading, functors, my head hurts... Please help?Quote:
That is a good one. __________________
"Opportunity is missed by most people because it comes dressed in overalls and looks like work." --Thomas Alva Edison "Those who would give up essential liberty to purchase a little temporary safety, deserve neither liberty nor safety." --Benjamin Franklin "A happy person is not a person in a certain set of circumstances, but rather a person with a certain set of attitudes." --Hugh Downs |
Recent GIDBlog
Once again, no time for hobbies by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Link List In C | Peter_APIIT | C Programming Language | 33 | 12-Jun-2008 14:33 |
| Str_Misaligned in Double Link List | Peter_APIIT | C Programming Language | 1 | 29-Feb-2008 21:50 |
| Linked list memory question | dabigmooish | C++ Forum | 3 | 31-Oct-2006 01:05 |
| search linked list | itsmecathys | C++ Forum | 20 | 18-Apr-2005 02:34 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The