Hi, I've written alot of threaded programs and there are many pitfalls to watch out for. My ultimate observation is that threaded programs are useful only when you need to easily share variables in realtime between threads, using threads::shared
. Otherwise, forking solutions using IPC::SysV
's shared memory segments, is probably preferrable. Threads just make it easy to share variables, and its tempting to use what is easy.
Remember, its also officially discouraged to consume alcohol, but how many people do it? :-)