Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 3
    By creating your own process model you are effectively creating your own threading system. You already have multiple "threads". Commented Dec 2, 2018 at 21:30
  • @candied_orange is this really a process model? I could have named the class Process ResourceUser and it may not have occurred to you. Commented Dec 2, 2018 at 21:46
  • 3
    Regardless of what you call it it's the same problem. How do you think multiple threads are created on single core computers? Your just doing it yourself. Be advised that doing this isn't simple. Commented Dec 2, 2018 at 21:56
  • 1
    If your point is "hey look, deadlock is possible without explicitly asking for a new thread" then yes I totally agree. This is why even in single thread code I free resources in the opposite order they were allocated. Because I have no idea how weird things will get outside the bounds of my class. Commented Dec 2, 2018 at 22:17
  • 1
    Reviewing your code for deadlocks is off-topic, but I'll be happy to write you an answer for the top half and what's in the title. Commented Dec 2, 2018 at 22:40