MUD-Dev
mailing list archive
[ Other Periods
| Other mailing lists
| Search
]
Date:
[ Previous
| Next
]
Thread:
[ Previous
| Next
]
Index:
[ Author
| Date
| Thread
]
Re: Unique id's
> From: coder#ibm,net
> To: Multiple Recipients of MUD Design Mailing List <mud-dev#null,net>
> Date: Sunday, April 13, 1997 12:16 PM
>
> >Ahh your ID has two parts. I use something called a CriticalSection
> >object to block the ' id++; ' function. Its very similar to a mutex,
> >except the reset occurs automatically upon leaving the code section.
> >Its supposed be slightly more efficient, but I believe its really a mutex
> >under the covers. I use it alot, all over the place. :-)
>
> Check into the base code for your CriticalSection. I've seen far to many
> such blobs whose definition of a critical section is that it is the ONLY
> thread in the application allowed to execute for the duration. <shudder>
> (This how OS/2 and Windows handle their "critical section" API's, and I've
> seen something similar in a library that shall remain nameless for SunOS).
>
Ah not to worry. The following is pasted from my help file. I will of course
check it out at the debug level to make certain.
--cut--
For the threads of a single process, critical-section objects provide another (and slightly more efficient) means of
synchronization. A critical section is used like a mutex to enable only one thread at a time to use the protected resource. A
thread uses the EnterCriticalSection function to request ownership of a critical section. If it is already owned by another thread,
the requesting thread is blocked. After it receives ownership, the thread is free to use the protected resource. The execution of
the other threads of the process is not affected unless they attempt to enter the same critical section.
--end cut--
JL
- Thread context:
- Re: Unique id's, (continued)
- Re: Unique id's,
coder coder#ibm,net, Sat 12 Apr 1997, 13:55 GMT
- Re: Unique id's,
Jon A. Lambert jlsysinc#ix,netcom.com, Sat 12 Apr 1997, 23:53 GMT
- Re: Unique id's,
coder coder#ibm,net, Mon 14 Apr 1997, 00:01 GMT
- Re: Unique id's,
Jeff Kesselman jeffk#tenetwork,com, Mon 14 Apr 1997, 02:40 GMT
- Re: Unique id's,
Jon A. Lambert jlsysinc#ix,netcom.com, Mon 14 Apr 1997, 04:31 GMT
- Re: Unique id's,
clawrenc clawrenc#cup,hp.com, Mon 14 Apr 1997, 23:24 GMT
- self-intro: Cynbe,
Cynbe ru Taren cynbe#laurel,actlab.utexas.edu, Wed 09 Apr 1997, 10:54 GMT
- Yet Another Introduction,
Reed D. Copsey, Jr. rdc#spiritone,com, Wed 09 Apr 1997, 09:29 GMT
[ Other Periods
| Other mailing lists
| Search
]