Re: how to get userland pthreads working?

2012-04-12 Thread Alexandre Ratchov
On Wed, Apr 11, 2012 at 02:00:28AM -0700, Philip Guenther wrote:
> 
> BTW, any particular reason for wanting to switch back?  Something not
> working right or a regression in performance or behavior?
> 

They behave differently; with rthreads multi-threaded processes
tend to get more cpu than single threaded processes (while with
uthreads all processes are treated equally).

AFAICS, the same is true for disk i/o, multi-threaded processes may
have multiple pending file reads/writes (in parallel), while single
threaded process are allowed to generate less i/o since each disk
request must to complete before the next request is made.

Whether this is desirable obviously depends on use-case. I.e. on
what compromise you make between determinism or performance.

-- Alexandre



Re: how to get userland pthreads working?

2012-04-11 Thread Mo Libden
Wed, 11 Apr 2012 02:00:28 -0700 P>Q Philip Guenther :
> On Wed, Apr 11, 2012 at 12:28 AM, Mo Libden  wrote:
> > Tue, 10 Apr 2012 11:10:09 -0700 P>Q  Philip Guenther :
> ...
> >> Running -current with userland threads is not supported.  If you need
> >> userland threads, you need to run 5.1 or earlier.
> >
> > That was what I really needed. Thank you!
> >
> > It is not stated clearly in the pthreads man page.
> > The man page still says it is a userland library implementation,
> > which obviously is not true anymore. That's why I asked.
> 
> Perhaps if we hit a blocker that would keep rthreads from being ready
> for the 5.2 release we'll be reverting the switch.  Some parts of the
> docs might not be updated until we are confident that won't occur.

Thank you, that's clear.  I hope rthreads will make it, they're hot :-)

> BTW, any particular reason for wanting to switch back?  Something not
> working right or a regression in performance or behavior?

No, nothing in particular. I just used to think ahead of other possible
scenarios like "what if this something goes wrong, how do i..."
Since rthreads seem to be controlled with sysctl, I had impression
that setting kern.rthreads=0 would turn old libpthread back.
Like libpthread has some kind of check for kern.rthreads and
chooses what functions to use according to the value.
Now, thanks to you I know how the things currently are.

> > Now, for the following, what's up with the immediate disclaimers?
> > Only asked a question, sheesh. Nobody asked for support or
> > anything similar. Being with OpenBSD since 1996, I kinda know the
> > versioning and the terms for the support.
> 
> Ah misc@, where half the people need the FAQ read to them and the
> other half are insulted when someone tries to answer the obvious next
> question.

No, in my head it's not "obvious next question". If I had come with some
problem like "i compile package X and it fails with rthreads", that might
be the case. However, my e-mail started with "I wrote a two string program
to check rthreads, it looks really interesting!" So it is obvious I was just
playing around with this, looking how the rthreads are processed by
the OS (checked OS tools like ps, top etc.). Anyway, we can drop this part
:-)

> Philip Guenther

Thanks!



Re: how to get userland pthreads working?

2012-04-11 Thread Philip Guenther
On Wed, Apr 11, 2012 at 12:28 AM, Mo Libden  wrote:
> Tue, 10 Apr 2012 11:10:09 -0700 P>Q  Philip Guenther :
...
>> Running -current with userland threads is not supported.  If you need
>> userland threads, you need to run 5.1 or earlier.
>
> That was what I really needed. Thank you!
>
> It is not stated clearly in the pthreads man page.
> The man page still says it is a userland library implementation,
> which obviously is not true anymore. That's why I asked.

Perhaps if we hit a blocker that would keep rthreads from being ready
for the 5.2 release we'll be reverting the switch.  Some parts of the
docs might not be updated until we are confident that won't occur.

BTW, any particular reason for wanting to switch back?  Something not
working right or a regression in performance or behavior?


> Now, for the following, what's up with the immediate disclaimers?
> Only asked a question, sheesh. Nobody asked for support or
> anything similar. Being with OpenBSD since 1996, I kinda know the
> versioning and the terms for the support.

Ah misc@, where half the people need the FAQ read to them and the
other half are insulted when someone tries to answer the obvious next
question.


Philip Guenther



Re[2]: how to get userland pthreads working?

2012-04-11 Thread Mo Libden
Tue, 10 Apr 2012 11:10:09 -0700 P>Q Philip Guenther :
> On Tue, Apr 10, 2012 at 10:41 AM, Mo Libden  wrote:
> > I wrote a two string program to check rthreads, it looks really interesting!
> >
> > I am interested how do I get pure userland library back in case I need?
> > Just setting kern.rthreads=0 seems to be not enough: pthread_create()
> > fails this case as not supported.
> >
> > Do I need to link the program against another library? Anything else?
> 
> Running -current with userland threads is not supported.  If you need
> userland threads, you need to run 5.1 or earlier. 

That was what I really needed. Thank you!

It is not stated clearly in the pthreads man page.
The man page still says it is a userland library implementation,
which obviously is not true anymore. That's why I asked.

Now, for the following, what's up with the immediate disclaimers?
Only asked a question, sheesh. Nobody asked for support or
anything similar. Being with OpenBSD since 1996, I kinda know the
versioning and the terms for the support.

> As for how to do
> that, well, to quote section 5.1 of the FAQ:
> --
> One should also understand that the upgrade process is supported in
> only one direction: from older to newer, and from -stable to -current.
> You can not run 5.0-current (or a snapshot), then decide you are
> living too dangerously, and step back to 5.0-stable. You are on your
> own if you choose any path other than the supported option of
> reloading your system from scratch, do not expect assistance from the
> OpenBSD development team.
> --
> 
> 
> Philip Guenther



Re: how to get userland pthreads working?

2012-04-10 Thread Philip Guenther
On Tue, Apr 10, 2012 at 10:41 AM, Mo Libden  wrote:
> I wrote a two string program to check rthreads, it looks really interesting!
>
> I am interested how do I get pure userland library back in case I need?
> Just setting kern.rthreads=0 seems to be not enough: pthread_create()
> fails this case as not supported.
>
> Do I need to link the program against another library? Anything else?

Running -current with userland threads is not supported.  If you need
userland threads, you need to run 5.1 or earlier.  As for how to do
that, well, to quote section 5.1 of the FAQ:
--
One should also understand that the upgrade process is supported in
only one direction: from older to newer, and from -stable to -current.
You can not run 5.0-current (or a snapshot), then decide you are
living too dangerously, and step back to 5.0-stable. You are on your
own if you choose any path other than the supported option of
reloading your system from scratch, do not expect assistance from the
OpenBSD development team.
--


Philip Guenther



how to get userland pthreads working?

2012-04-10 Thread Mo Libden
Hi!

I wrote a two string program to check rthreads, it looks really interesting!

I am interested how do I get pure userland library back in case I need?
Just setting kern.rthreads=0 seems to be not enough: pthread_create()
fails this case as not supported.

Do I need to link the program against another library? Anything else?

Thank you in advance!

m/

P.S. sorry if I am asking something obvious ;-)