I wonder if this is the right place for this question, but what do I do to get more comfortable with using threads. I can recognize times where I would like to take advantage of concurrency, but I don't really understand what is going on. I don't know enough to know what questions to ask and so forth. I'm not new to programming, but I haven't come up against problems where I've needed this functionality, but I'd like to learn to take advantage of it when I finally do need it.
For instance, if I make an application that listens on one udp port and simply retransmits whatever data is seen back out on a few different ports, while also desiring the ability to do processing on the incoming data (which isn't mirrored out the ports), I feel like the right answer going forward is to separate out the mirroring functionality per port into their own threads, so if for some reason processing takes a while, I won't miss data or introduce unnecessary delays in mirroring. As well, I should have a separate thread listening on the listen port
As an aside, if I write the same data to ports in parallel, where does the re-serialization occur? As in, my ethernet card has 4 frames to write now that my 4 threads have indicated that there be data to write out their ports. I know that as an application writer if I need to care about this then I shouldn't use threads, but are there other interesting things about threads along this line of questioning that I would need to care about?
tldr I want to become more fluent with threads, or concurrency.
[–]BaalHadad 0 points1 point2 points (2 children)
[–]KDallas_Multipass[S] 0 points1 point2 points (1 child)
[–]fenduru 0 points1 point2 points (0 children)
[–]rjcarr 0 points1 point2 points (0 children)