[MUD-Dev] Two threads forced to one CPU? (was: Collecting ideas for a MUD server...)
Hans-Henrik Staerfeldt
hhs at cbs.dtu.dk
Tue Dec 28 10:22:02 CET 1999
On Fri, 24 Dec 1999 cg at ami-cg.GraySage.Edmonton.AB.CA wrote:
> [Greg Miller:]
>=20
> > BTW: Here's something else anyone doing MT should be aware of: Your
> > software may have two sets of thread bugs, one for single-CPU executi=
on,
> > and one for MP execution. There may or may not be overlap between the
> > two. That means you *cannot* assume your MT application runs on both,
> > unless you've tested and otherwise verified your code in both
> > situations.
>=20
> Excellent advice! At work, I've worked on threaded software on machines
> with 1 2, and 4 CPU's, all on Windows NT. Bugs show up at all levels of
> that, and some of them can be difficult to figure out, since they can b=
e
> timing dependent. You've got to be extremely careful with any locking,
> etc. that you need. And, you've got to make *no* assumptions about
> things getting done and the timing of them.
>=20
Yes, or keep assuming the worst possible. Assume that the thread can be=20
interrupted, after you have written down 16 of 32 bit of any long word=20
in the memory, making the 32-bit value non-valid, which is why you need
thread-safe system calls :-) I actually had this error, though on older=20
hardware.=20
Hans Henrik St=E6rfeldt | bombman at diku.dk | work: hhs at cbs.dtu.dk=
|
address: |___ +45 40383492 __|__ +45 45252425 =
__|
Dybendalsvej 74 2. th, | Scientific programmer at Center for Biological =
|
2720 Vanl=F8se, Danmark. | Sequence Analysis, Technical University of D=
enmark|
_______________________________________________
MUD-Dev maillist - MUD-Dev at kanga.nu
http://www.kanga.nu/lists/listinfo/mud-dev
More information about the mud-dev-archive
mailing list