Operating System - HP-UX
1833567 Members
3328 Online
110061 Solutions
New Discussion

HPUX10.20 and dce threads

 
Arthur Prosso
Occasional Contributor

HPUX10.20 and dce threads

Hello.
What DCE pthread_ functions can suspend and resume a thread?
Thank you,
Arthur
6 REPLIES 6
Umapathy S
Honored Contributor

Re: HPUX10.20 and dce threads

Arthur,
There are no direct PThread APIs which can suspend and resume a thread. We have to write our own.

HTH,
Umapathy
Arise Awake and Stop NOT till the goal is Reached!
Arthur Prosso
Occasional Contributor

Re: HPUX10.20 and dce threads

Umapathy,
That's true that there are no direct APIs
that suspend and resume threads.
In POSIX thread we can call pthread_kill with
SIGSTOP and SIGCONT correspondingly.
Do you have any clue what can be done with DCE threads?
Thank you
Elena Leontieva
Esteemed Contributor

Re: HPUX10.20 and dce threads

Arthur,

This is from http://www2.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000009491262


HP-UX Threads Extensions
------------------------

In addition to the POSIX threads functions, HP-UX provides the
extensions shown in the following table. These non-standardized
interfaces are subject to change; efforts are being made to standardize
them through X/Open.

Table 1-11 Additional HP threads routines
HP threads Extension, followed by Purpose

pthread_suspend():
Suspends a thread and blocks until the target thread has been
suspended. Each time a thread is suspended, its suspension count is
incremented.

pthread_continue:
Resumes execution of a suspended thread.

pthread_resume_np():
An HP-only function that provides control over how a thread is
resumed by a flags field.

pthread_num_processors_np():
Returns number of processors installed on the system.

pthread_processor_bind_np():
Binds thread to processor.

pthread_processor_id_np():
Identifies a specific processor on the system.
Paddy_1
Valued Contributor

Re: HPUX10.20 and dce threads

The POSIX standard provides no mechanism by which a thread A can suspend the execution of another thread B, without cooperation from B. The only way to implement a suspend/restart mechanism is to have B check periodically some global variable for a suspend request and then suspend itself on a condition variable, which another thread can signal later to restart B.
The sufficiency of my merit is to know that my merit is NOT sufficient
Umapathy S
Honored Contributor

Re: HPUX10.20 and dce threads

Arthur,
There is no direct way to achieve this in DCE threads. One way is to go for a semaphore and lock on it till your desired time. You have make a seperate logic depending upon your requirements.

HTH,
Umapathy
Arise Awake and Stop NOT till the goal is Reached!
Arthur Prosso
Occasional Contributor

Re: HPUX10.20 and dce threads

Thanks everyone who answered.
Elena, I meant the DCE threads on 10.20, not the POSIX threads on 11.00. No vse ravno spasibo.