Comments on Replacing C

Hal Murray hmurray at megapathdsl.net
Mon Jan 9 02:40:42 UTC 2017


> Yes, threads will help a lot.  I remember when Apache and Mysql started to
> use good threading.  It really helps when you can use all 16 cores on a CPU
> instead of just one.

That depends on the nature of your problem.  In addition to threads, you also 
need locks.  If most of the work is under a single lock, more threads won't 
help.  All the extra threads will be waiting for the lock.

For NTP, it might make sense to split things into two processes.  the client 
side in one and the server side in another.  The client would only need a 
single thread.  The server side doesn't have much state that needs a lock so 
many threads should work fine. I don't know how to cleanly pass info from the 
client to the server.  Maybe it all goes through the kernel and the server 
side gets all it needs to know from ntp_adjtime.  Maybe a SHM like interface.


>> Eric has occasionally said non-good things about threads.

> And I 100% agree, if we are talking about Python threads.  With the GIL the
> performance is no improvement over single trheaded. 

That's a separate issue.

Eric was talking about architecture issues, c rather than Python.  Poorly 
done threads are very difficult to understand.

Eric: We should add cleaning up the DNS threads to the list.


-- 
These are my opinions.  I hate spam.





More information about the devel mailing list