Subject: Re: pthread/LWP oddity/bug? 27023 related?
To: None <tech-kern@netbsd.org>
From: Bill Studenmund <wrstuden@netbsd.org>
List: tech-kern
Date: 10/05/2004 18:58:44
--yEPQxsgoJgBvi8ip
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Oct 06, 2004 at 12:00:32AM +0200, Reinoud Zandijk wrote:
> Dear folks,
>=20
> in my testing of one of the LWP problem-reports i am working on i ran the=
=20
> attached program that creates about a 100 threads that each wait for a=20
> specified signal... and got the following `output' :

[snip]

> pthread_run.c :
> ----------
>         } else {
>                 next =3D PTQ_FIRST(&pthread__idlequeue);
>=20
> 130:            pthread__assert(next !=3D 0);
>=20
>                 PTQ_REMOVE(&pthread__idlequeue, next, pt_runq);
>                 pthread__assert(next->pt_type =3D=3D PT_THREAD_IDLE);
>                 SDPRINTF(("(next %p) returning idle thread %p\n", self,=
=20
> next));
>         }
> ----------
>=20
> Now does this point to pages not being `wired' or why isnt it just swappi=
ng=20
> it in ?

I really doubt it's a problem with pages not being 'wired'. The=20
application won't notice that pages aren't present - it will be blocked=20
while allocated pages get swapped in.

The problem is that the code makes an assumption about the state of all of=
=20
the threads, and that assumption is wrong.

I don't fully understand what the assumption is (other than it's the=20
assert :-) but I'd say you should look at what state the threads are in=20
and what state the code expects them in.

Take care,

Bill

--yEPQxsgoJgBvi8ip
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (NetBSD)

iD8DBQFBY1FUWz+3JHUci9cRArjUAJ9UspxC9NAwxOIeajIeltVxrIR4hwCgj3Bc
1ZXxhFgCvudcF0CmsYxrF9o=
=QRU2
-----END PGP SIGNATURE-----

--yEPQxsgoJgBvi8ip--