United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-7132070 Use a mach_port_t as the OSThread thread_id rather than pthread_t on BSD/OSX
JDK-7132070 : Use a mach_port_t as the OSThread thread_id rather than pthread_t on BSD/OSX

Details
Type:
Bug
Submit Date:
2012-01-20
Status:
Closed
Updated Date:
2013-08-09
Project Name:
JDK
Resolved Date:
2012-02-27
Component:
hotspot
OS:
os_x
Sub-Component:
runtime
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
hs23
Fixed Versions:
hs24 (b01)

Related Reports
Backport:
Backport:
Backport:
Backport:
Backport:
Relates:

Sub Tasks

Description
On OSX, a pthread_t is used as the native thread id in an OSThread.  pthread_t
is a 8-byte value rather a 4-byte value as it is on the other supported platforms.
Java Flight Recorder currently relies on the thread id being 4 rather than 8 bytes,
and it would require a file format change to switch.  The thread id is an identifier
and doesn't appear to be used for anything else on OSX.

Rather than change file formats, it might be possible to instead use a mach_port_t,
which is an unsigned int (and thus 4 bytes).  To get it, use

mach_port_t tid = pthread_mach_thread_np(pthread_self());

                                    

Comments
EVALUATION

http://hg.openjdk.java.net/hsx/hotspot-rt/hotspot/rev/0368109684cb
                                     
2012-02-20
EVALUATION

http://hg.openjdk.java.net/hsx/hotspot-main/hotspot/rev/0368109684cb
                                     
2012-02-22
EVALUATION

http://hg.openjdk.java.net/lambda/lambda/hotspot/rev/0368109684cb
                                     
2012-03-22
EVALUATION

http://hg.openjdk.java.net/hsx/hsx23.2/hotspot/rev/adaa2f10c81b
                                     
2012-05-08



Hardware and Software, Engineered to Work Together