Hi fellow CP'ians,
i encountered a new problem while thinking about multi user software. Sohort background story...
I have in mind that the upcomming multiuser system should and will run with an observer to dedicate massages and updates to the software. But currently i don't get the timeslot to implement that, that's why i went on another approach using locks (that get stored into the DB).
Soooo, now im thinking about different scenarios like a project manager sets the project into edit mode (locks get set for every object in the project) and there is someone already working on an object. In this case i can't lock it for the PM and have to notify him (will use a small icon) but i have to recheck till the other dude closed his edit and the PM can finally lock it.
For this i wanted to use a seperate thread that querys the DB regularly till the object can be locked.
Now to my Question:
Since i worked a bit with threads i realised that it won't work that smooth if you leave a method in which you created a thread. So just for me as input. Is my feeling right?
I would try to set up like this
public bool LockProject(GUID InProjectID)
{
bool _result = false;
return _result;
}
So would this "kill" my thread? I expect it to return true, since we could lock the project for others but still need to check. So if i leave the method, will the Thread get dumped by the garbage collection or would this work?
Otherwise, where would i have to put the Thread? Is this realisable with this Task thing i read
here?
I don't need code, just a push in the right direction or if my thoughts are correct a confirmation.
Thanks in advance :)
What I have tried:
As written above, the thoughts about how to handle this issue.