Threads and modules

Arran Cudbard-Bell a.cudbardb at
Mon Mar 23 23:08:24 CET 2015

> On 23 Mar 2015, at 17:51, Matthew Newton <mcn4 at LEICESTER.AC.UK> wrote:
> On Mon, Mar 23, 2015 at 09:40:55PM +0000, Matthew Newton wrote:
>> I've been working on the belief that each separate thread in
>> FreeRADIUS has a separate instantiation of each module, e.g. a new
>> thread calls mod_instantiate at startup and mod_detach at finish.
>> Therefore an instantiation of the module is all within one thread.
>> I'm now thinking about this further, and believe I'm wrong...?
> Thinking about it more, and checking the code, yes I'm wrong. Just
> not sure why I even thought that in the first place. Been staring
> at this for too long I guess.
> I'll add a connection pool to the mschap winbind code so it
> doesn't have threading issues... as always annoying the issues
> only show up under load, not in normal testing.

I was wondering about that...

I figured you'd done some TLS magic in the samba patches, but I guess not :)

Yes, you'll need a connection pool.

There's no per module/thread instantiators or destructors.

It's also the reason why you never parent memory allocated when processing a
request, from the context of the module instance.

Arran Cudbard-Bell <a.cudbardb at>
FreeRADIUS development team

FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 872 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <>

More information about the Freeradius-Devel mailing list