Marc Balmer wrote:

Tomasz Kojm wrote:

The current CVS code contains a new directive: UseProcesses that will
cause clamd to use processes instead of threads. Initial version but
seems to work ;) It should be really useful for clamav-milter users.


What are the advantages of processes vs. threads in this case? Doesn't the creation of processes use more ressources?

Thanks for clarification.

- Marc

There _are_ current issues with thread-based clamd (and thread-based software in general, as everything (memory, fd's etc)is shared between threads:
- some users (especially milter users) report clamd "freezing", effectively stopping mail queueing
- resource cleanup in clamd is not optimal (especially on internal failures, where fd's are not closed and some memory is not free()'d)


Cons:
- On some architectures, fork()/exec() are a lot slower than pthread_create() (Solaris comes to mind)
- lightly increased resource usage on "modern" systems where forked processes share memory until one process writes to it (copy-on-write), and greatly incresed resource usage where such feature is not provided


Pros:
- Every clamd subprocess can directly exit() on failure; all resources are automatically free()d and fd's are closed.
- No need for mutexes to keep track of writes to memory areas shared by all threads (think of 3rd party libraries that may be not thread save, even in some small areas only)
- one mad-running thread can't take the hole process down



I think it's a great leap toward real production quality for clamd. A big Thank You to Tomasz for making that feature available in the main trunk (for those who didn't know: a patch for that did already exist, but it was either "run CVS versin with threads", or "run patched version with fork/exec" AFAIR).


Again, Thanks!



Thomas



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
Clamav-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/clamav-users

Reply via email to