Wireshark-users: Re: [Wireshark-users] ./configure --enable-threads is not really enabling them

From: Gerald Combs <gerald@xxxxxxxxxxxxx>
Date: Sun, 28 Jun 2009 14:43:41 -0700
Andrei Pirvan wrote:
Hello. I tried to build Wireshark 1.0.8 and Wireshark 1.2.0 on Ubuntu
9.04 amd64 with threads support. The configure script reports at the
end that threads will be used (Use threads : yes), but when I run the
program with "libtool --mode=execute gdb wireshark" I can see only the
main thread. Also, I noticed that "defined USE_THREADS" it's false (in
gtk/main.c), so that's the reason why it won't use threads, even if
"defined(G_THREADS_ENABLED)" is true. I need it because I must run
another thread used to inject some packets, and must have the
interface updating in the same time. Thanks in advance for any ideas.

Thread support has been neglected, unfortunately. One reason is that GTK+ hasn't supported threads very well on Windows as discussed at

  http://www.wireshark.org/lists/wireshark-dev/200611/msg00172.html

and

  http://library.gnome.org/devel/gdk/stable/gdk-Threads.html

Another reason is that the obvious application for threads (parallelized packet dissection) is really, really hard to implement in the current codebase. We should probably revisit the threads issue just to see what we can & can't do within Wireshark. At the very least we need to clean up the "--enable-threads" configure option.

Does packet injection require elevated privileges? If so, you should use a separate process for that similar to dumpcap.