Usenet comp.unix.tru64 (2000-2013)
 help / color / mirror / Atom feed
From: "Ioannis E. Venetis" <iev@hpclab.ceid.upatras.gr>
Subject: Re: Thread safe malloc in Tru64?
Date: Tue, 25 Nov 2003 18:16:14 +0200	[thread overview]
Message-ID: <bpvv8j$u02$1@ulysses.noc.ntua.gr> (raw)
In-Reply-To: 3fbe10c5@usenet01.boi.hp.com

First of all, thank you for your very detailed answer.

It seems that my choice to use the Mach interface on the Tru64 Unix
system was unfortunate. Anyway, it is quite trivial to change the machine
dependant part of the library to use POSIX threads for this architecture
and I will do it. But there still remains a very important problem, at least
for me :-)

This library is also to be run on a simulator. The simulator is based on
an Alpha processor and it has some extensions to support Simultaneous
Multithreading (SMT). It executes static binaries created on Tru64
Unix systems and it explicitly does NOT support POSIX Threads.
Instead, the machine dependant part of the library HAS to use the
primitives of the simulator to start and manage hardware threads, if
parallel applications are to be run on the simulator (there is no OS, so
hardware threads can be thought of as equivalent entities
to kernel threads when an OS is present). The problem of course is
that malloc() returns the same addresses for allocated regions when
executed concurrently on more hardware threads, since the linked in
C library is not thread safe. Moreover, the simulator does not provide
mmap() (which would perhaps help me overcome the problem, as on
the real Tru64 system). This means that I still need to find another way
to link thread safe versions of libraries with my applications, in order to
successfully run these applications on the simulator. It seems that it will
not be possible for me to avoid some kind of hacks, at least to make
the library run on the simulator.

The very easy solution to use a lock around each malloc() in the
library did not help. Of course I did not use POSIX primitives
for the locks, but hand-written assembly code (which runs correctly,
both on the Tru64 system and the simulator).

Any other suggestion on this issue is greatly appreciated.

Ioannis E. Venetis
PhD Student - Research Assistant
High Performance Information Systems Laboratory
Computer Engineering and Informatics Department
University of Patras, Greece
URL: http://www.hpclab.ceid.upatras.gr/pgroup/members/iev




      reply	other threads:[~2003-11-25 16:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-20 14:11 Thread safe malloc in Tru64? Ioannis E. Venetis
2003-11-20 16:30 ` Jerry Feldman
2003-11-21 13:16 ` David Butenhof
2003-11-25 16:16   ` Ioannis E. Venetis [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox