Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Feb 2003 02:54:59 -0800
From:      Alfred Perlstein <alfred@FreeBSD.org>
To:        Alexey Zelkin <phantom@FreeBSD.org.ua>
Cc:        src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org, legacy-committers@FreeBSD.org
Subject:   Re: cvs commit: src/include pthread.h src/lib/libc_r/uthread uthread_attr_getstack.c uthread_attr_setstack.c src/lib/libpthread/thread thr_attr_getstack.c thr_attr_setstack.c src/lib/libc_r/man pthread_attr.3
Message-ID:  <20030210105459.GU88781@elvis.mu.org>
In-Reply-To: <20030210120147.A25796@phantom.cris.net>
References:  <200302100848.h1A8m4Fj054987@repoman.freebsd.org> <20030210120147.A25796@phantom.cris.net>

next in thread | previous in thread | raw e-mail | index | archive | help
> On Mon, Feb 10, 2003 at 12:48:04AM -0800, Alfred Perlstein wrote:
> >   Log:
> >   Add pthread_attr_getstack() and pthread_attr_setstack().

* Alexey Zelkin <phantom@FreeBSD.org.ua> [030210 01:55] wrote:
> hi,
> 
> Who reviewed this change ?  Did you told to Dan before doing it ?

I thought it was fine, I've done work on the pthreads library before.

> And last, that purpose of this functionality ?  (I have seen a diff,
> but it's interesting how these functions are supposed to be used?)

This is to bring us a function that is required by:
http://www.opengroup.org/onlinepubs/007904975/functions/pthread_attr_getstack.html

> PS: We have pthread_attr_get_np() which provide functionality similar
> to pthread_attr_getstack() in cleaner and correct way.  Having of
> pthread_attr_setstack() is absolutely crazy idea (IMHO) because using it
> after pthread_create() may (or will) crash application.

Well yes, but this is needed for standards compliance.  Afaik when one
passes in an attribute it is deep copied within the pthread_create call
hence this can only be effective before the call to pthread_create.

Also we have uthread_attr_setstackaddr.c and uthread_attr_setstacksize.c
which setstack is simply a combination of them specified by the standard.

-Alfred

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030210105459.GU88781>