[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference azur::mcc

Title:DECmcc user notes file. Does not replace IPMT.
Notice:Use IPMT for problems. Newsletter location in note 6187
Moderator:TAEC::BEROUD
Created:Mon Aug 21 1989
Last Modified:Wed Jun 04 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:6497
Total number of notes:27359

2540.0. "Does the routine mcc_lock_acquire_exclusive have a time-out value?" by TAEC::SILVA (Carl Silva, TBG Eng, SAT-0/C-H6, DTN:828-5339) Wed Mar 11 1992 10:27

	Does the routine mcc_lock_acquire_exclusive have a time-out value
associated with it and if so, what is the value?

	If it does not, is this planned for the future?  Or can someone think
of another way I could do this (without creating two threads)?

	Carl
T.RTitleUserPersonal
Name
DateLines
2540.1Use threadsTOOK::BURGESSThu Mar 12 1992 14:1917
	No, there are no time-outs associated with the lock rtns.

	I recommend creating a tmo thread to
		delay (t)
		if not alerted, then send-alert to parent thread
		return

	parent thread
		create tmo thread
		lock_acquire
		if stat neq alert, then send-alert to tmo-thread
		...

Note that lock identifiers belong to the creating thread and
can only be used by that creating thread.

\Pete
2540.2Thanks for the response, Pete!TAEC::SILVACarl Silva, TBG Eng, SAT-0/C-H6, DTN:828-5339Fri Mar 13 1992 04:3027
	RE: .1,

>	No, there are no time-outs associated with the lock rtns.

	OK.  Do these routines use the cma_mutex or cma_cond functions
internally?

>	I recommend creating a tmo thread to
>		delay (t)
>		if not alerted, then send-alert to parent thread
>		return
>
>	parent thread
>		create tmo thread
>		lock_acquire
>		if stat neq alert, then send-alert to tmo-thread
>		...
>
>Note that lock identifiers belong to the creating thread and
>can only be used by that creating thread.

	You wouldn't happen to have a little example code that does this, would
you?

	Wouldn't it be just as easy to have the mcc_lock routines do this?

	Carl
2540.3Check out the Example FM Library source codeNANOVX::ROBERTSKeith Roberts - DECmcc Toolkit TeamFri Mar 13 1992 10:5820
RE: .2

> You wouldn't happen to have a little example code that does this, would you?

  Carl,

  There is a time-out routine in the Example FM Library.  You got this
  source code when you installed the DECmcc Toolkit.  The files are in:

	   VMS:  mcc_examples:mcc_example_fm_library.c
	ULTRIX:  /usr/mcc/mmtoolkit/examples/mcc_example_fm_library.c

  The routine name is:  exlib_timed_operation

> Wouldn't it be just as easy to have the mcc_lock routines do this?

  I would think so, but ... what do I know.


  /keith
2540.4suggestion notedTOOK::BURGESSFri Mar 13 1992 15:251
Thank you for the suggestion, Carl.
2540.5Thanks!TAEC::SILVACarl Silva, TBG Eng, SAT-0/C-H6, DTN:828-5339Mon Mar 16 1992 05:137
	RE: .3,

	Thanks for the pointer.  I'll check it out.

	RE: .4,

	Well, it was just an idea.  8-)