It would probably be a good idea to make gethostbyname() thread safe.
This is on Linux, I presume. The libc call is guarded by a mutex, so it should be thread safe as long as no nonpike threads use it.
/ Martin Stjernholm, Roxen IS
Previous text:
2003-07-03 00:15: Subject: gethostbyname()
It would probably be a good idea to make gethostbyname() thread safe.
/ Johan Sundström (folkskådare)
I had two pike-threads that did gethostbyname().
This on RH9. They sometimes randomly got the same answer.
/ Per Hedbor ()
Previous text:
2003-07-03 00:41: Subject: gethostbyname()
This is on Linux, I presume. The libc call is guarded by a mutex, so it should be thread safe as long as no nonpike threads use it.
/ Martin Stjernholm, Roxen IS
In the last episode (Jul 03), Per Hedbor () @ Pike (-) developers forum said:
Previous text:
This is on Linux, I presume. The libc call is guarded by a mutex, so it should be thread safe as long as no nonpike threads use it.
I had two pike-threads that did gethostbyname().
This on RH9. They sometimes randomly got the same answer.
The problem isn't gethostbyname() itself, it's the returned buffer. Pike needs to copy the data to a separate area before releasing gethostbyname_mutex.
It guards the call with a mutex, but it doesn't bother to copy away the result before releasing it. :P
/ Martin Stjernholm, Roxen IS
Previous text:
2003-07-03 00:42: Subject: gethostbyname()
I had two pike-threads that did gethostbyname().
This on RH9. They sometimes randomly got the same answer.
/ Per Hedbor ()
Someone better make a crunch ticket about it; at least I have other things to do right now.
/ Martin Stjernholm, Roxen IS
Previous text:
2003-07-03 00:51: Subject: gethostbyname()
It guards the call with a mutex, but it doesn't bother to copy away the result before releasing it. :P
/ Martin Stjernholm, Roxen IS
pike-devel@lists.lysator.liu.se