threads/72429: threads blocked in stdio (fgets, etc) are not
cancellable in 5.3 (works in 4.x)
Mark Gooderum
mark at verniernetworks.com
Thu Oct 7 14:14:48 PDT 2004
But this is a major change in behavior from FreeBSD 4 and also a
difference from Linux. I'm not a Linux bigot at all but there is a
recurring theme that XX threaded apps works on Linux but is unstable on
FreeBSD and these sort of major behavior deltas contribute to the
perception of FreeBSD threading as unstable by some.
In fact it means that any thread doing blocking stdio is uncancellable -
the standard may not require it but many applications might expect it.
Given that the functionality was there in 4.x and lost in 5.x I'd call
it a regression.
I've no goal of being a "johnny come lately" and criticize choices made
earlier but I am part of a company using FreeBSD as part of it's core
technology and we're in the midst of migrating our product code base
from FreeBSD 4.9 (most recent, been trucking along since 4.3) to FreeBSD
5.3 and these are the sort of changes that break things and cause pain
for developers. Parts of our code have been threaded from the start -
originally with PTH and then we made the transition to libc_r pthreads
about a year ago and now we're jumping to libpthread to stick with what
is "supported".
Just my polite $.02 worth.
-=-
Mark
>fgets is not a required cancellation point. See the POSIX standard.
>The standard says it, along with many other functions, _may_ be a
>cancellation point, but the only required cancellation points are:
>
> accept() mq_timedsend() putpmsg() sigtimedwait()
> aio_suspend() msgrcv() pwrite() sigwait()
> clock_nanosleep() msgsnd() read() sigwaitinfo()
> close() msync() readv() sleep()
> connect() nanosleep() recv() system()
> creat() open() recvfrom() tcdrain()
> fcntl()2 pause() recvmsg() usleep()
> fdatasync() poll() select() wait()
> fsync() pread() sem_timedwait() waitid()
> getmsg() pselect() sem_wait() waitpid()
> getpmsg() pthread_cond_timedwait() send() write()
> lockf() pthread_cond_wait() sendmsg() writev()
> mq_receive() pthread_join() sendto()
> mq_send() pthread_testcancel() sigpause()
> mq_timedreceive() putmsg() sigsuspend()
>
>
>
More information about the freebsd-threads
mailing list