DragonFly BSD
DragonFly users List (threaded) for 2006-06
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: Replacing Sendmail with Postfix in the base system


From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>
Date: Wed, 14 Jun 2006 11:34:33 -0700 (PDT)

:Hmm, is my English that bad? I _agree_ with most of your points, I
:do _not_ want to argue.  I just want to know about the ("race")
:"problems" in the libmilter code, because that's code I wrote. Just
:like you most likely would want to know details when I would write:
:"You don't deal with races in DragonFly".

    Well, for example, did you know that it is virtually impossible to use
    a DBM database in a threaded program due to the stupid POSIX-says-you-
    must-release-all-locks-on-close() problem?  You can't treat the threads
    as independant entities because of that locking issue.  Have you ever
    tried doing a DNS lookup from a threaded program?

    It took literally weeks for me to track down problems with my libmilter
    code due to the threading.

    I'll tell you what I want for a spam filter... just a simple unix
    domain socket that the filter can listen and accept connections on.
    Sendmail (or whatever) can then communicate by simply connecting to the
    socket.  Let the spam filter decide whether it wants to thread or fork.
    Simplify the protocol ... it's just a PIPE.  None of this callback crap.

    main()
    {
	...
	socket/bind/listen
	...
	accept/fork

	while ((state = get_milter_packet(fd)) != STATE_DEAD_CONNECTION) {
		... process state ...
		... return_milter_packet(responsecode, string) ...
	}
    }

    And that's IT.  That is all that is needed.  None of this threading
    crap.  None of these callbacks.... just a simple state machine and
    let the spam filter decide whether it wants to thread or not.

						-Matt




[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]