Program getting too high of a priority
Posted on 2004-08-19
I have a packet sniffer that uses libpthread and libpcap. There is one while(1) loop in one thread, but I call a sleep(300) at the beginning of the loop. The next thread basically just sets up the callback for libpcap. I noticed that when doing a 'top' listing, my threads are all listed at the top of the list. I am using the default scheduling for the threads. I noticed that when doing a tcpdump, it almost never gets put at the top of the list. How can I reduce the priority of my threads without dropping packets?