24.05.2014 Views

AIX Version 4.3 Differences Guide

AIX Version 4.3 Differences Guide

AIX Version 4.3 Differences Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

4.4 Pthreads Suspend and Resume (<strong>4.3</strong>.2)<br />

The pthreads library has been enhanced to provide the ability to suspend and<br />

resume individual threads. This function is added to <strong>AIX</strong> <strong>4.3</strong>.2 to assist in the<br />

porting of applications from other platforms.<br />

The pthreads implementation on <strong>AIX</strong> <strong>4.3</strong>.2 complies with the UNIX98 standard.<br />

The four new API functions are not part of this standard, and this is indicated by<br />

appending _np to their names to indicate that they are NON-POSIX compliant.<br />

The four new user functions are:<br />

• int pthread_suspend_np(pthread_t thread);<br />

• int pthread_continue_np(pthread_t thread);<br />

• int pthread_attr_setsuspendstate_np(pthread_attr_t *attr, int<br />

suspendstate);<br />

• int pthread_attr_getsuspendstate_np(pthread_attr_t *attr, int<br />

*suspendstate);<br />

The pthread_suspend_np and pthread_continue_np functions are used to<br />

immediately suspend and resume execution of the thread indicated by the<br />

function argument.<br />

The pthread_attr_getsuspendstate_np and pthread_attr_setsuspendstate_np<br />

functions are used to get and set the value of the new suspendstate member of<br />

the pthread_attr_t structure. The suspendstate argument can be set to either<br />

PTHREAD_CREATE_SUSPENDED_NP or<br />

PTHREAD_CREATE_UNSUSPENDED_NP. The default value of the<br />

suspendstate attribute of a pthread_attr_t structure is<br />

PTHREAD_CREATE_UNSUSPENDED_NP.<br />

The new functions work in both the 1:1 and M:N threading environments.<br />

4.5 Preserve Modified Ptrace Data (<strong>4.3</strong>.2)<br />

<strong>AIX</strong> <strong>4.3</strong>.2 has improved the performance of the ptrace() subroutine, which is<br />

used by debuggers to control the execution of applications under their control.<br />

Debuggers use a private copy of the text pages for the application being traced<br />

and any shared libraries it uses. This allows the debugger to modify the text<br />

pages to insert breakpoints without affecting any other processes on the system<br />

that may be running the same executable or shared library text.<br />

Prior to <strong>AIX</strong> <strong>4.3</strong>.2, when the application being debugged calls the load(), or<br />

loadbind() routines to load a private module into its address space, the system<br />

loader reloads fresh copies of all the text pages for the application and any<br />

required shared libraries. In so doing, any modifications made to the text pages<br />

are lost, so the debugger has to reinsert breakpoints after the application calls<br />

load() or loadbind().<br />

The function of the ptrace routine has been modified along with the system loader<br />

to maintain ptrace altered copies of text pages across calls to load or loadbind.<br />

This will improve the performance of the debugger when controlling large<br />

76 <strong>AIX</strong> <strong>Version</strong> <strong>4.3</strong> <strong>Differences</strong> <strong>Guide</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!