Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ MT-multithreading and servers » PROPOSAL: Monitor mutex in objects
PROPOSAL: Monitor mutex in objects [message #27378] Thu, 15 July 2010 11:42 Go to previous message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
hi guys,

in C# there exists a nice feature,
lock(objectinstance)
{
//method code on now protected object
}

one can protect another object of beeing somehow accessed / modified, while oneself is treating with it. the object itself doesnt know about that and does not need to take care on providing any synchonisation features inside.

would it be possible to make something like that in upp as well?
as far as i know, c# compiler helps here somehow..

meanwhile:

here is another maybe usefull construction, came in mind while i was dealing with Mt.h..

#define LOCKER UPP::Mutex __locker
#define LOCKED INTERLOCKED_(__locker)

class MyClass
{
	void Method()
	{
		LOCKED
		{
		//your per object locked code
		}
	}
};
private:
	LOCKER;
}

it's unlicke the pure INTERLOCKED, which would generate a StaticMutex in every method the LOCKED is used.

if it is sensefull...
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Stop Download
Next Topic: Problem when compiling multiple threads
Goto Forum:
  


Current Time: Sun May 12 22:14:18 CEST 2024

Total time taken to generate the page: 0.02324 seconds