Forum OpenACS Q&A: Re: anybody using [ns_thread begindetached]?

Collapse
Posted by Andrew Piskorski on
Yes, I use "ns_thread begindetached" regularly in AOLserver 3.3+ad13, although not often with OpenACS (which should make no difference). It works just fine, I believe exactly as documented. It definitely is doing something different from just "ns_thread begin", although FYI there was a bug in AOLserver 4 (fixed now I think) where "begindetached" was actually just doing the same thing as "begin".

I'm not using aolserver3.3ad13-oacs1-beta-src.tar.gz, I'm using the original 3.3+ad13 sources from aD, plus probably certain patches (I'd have to look). This is on Solaris.

FYI, when using plain "ns_thread begin" you don't have to wait for the thread to exit. Actually, I don't think I've ever tried it but I don't think anything bad will happen if you let the thread exit on its own without waiting for it. AFAIK the only difference between "begin" and "begindetached" is: With begin, you can wait for the thread to exit, and each such thread will count towards your configured maxthread number until it dies. With begindetached, you cannot wait for the thread to exit, and it does not count towards maxthread at all.