Critical sections in assembly

Shawn Silverman <[email protected]>
Newsgroups gmane.comp.hardware.microcontrollers.tini
Message-ID <[email protected]>
Hello.  I have some native code that messes with P5 and P6 pins to do 
some data transfer.  I wish for this to be "synchronized", except that 
is comparatively slow in Java.  My assumption is that I have two ways 
of doing this:

1)	WOS_DISABLE_INTERRUPTS
	FEEDDOG ; Just in case
	...do stuff...
	WOS_ENABLE_INTERRUPTS

or

2)	TINIOS_ENTER_CRITICAL_SECTION
	...do stuff...
	TINIOS_EXIT_CRITICAL_SECTION

My question is what is the effect of option #2?  I know that disabling 
interrupts disallows everything else, and so my code is probably 
guaranteed to operate by itself.  What about critical sections?  I 
haven't been able to find what this actually does with respect to 
TINIOS.  Does it prevent task swapping?  How does it protect resources? 
  etc...

My next question is can native methods be declared as 'synchronized'?

Thanks,
	-Shawn

_______________________________________________
TINI mailing list
TINI-6tN4nzCoH/[email protected]
To UNSUBSCRIBE, edit your profile, or see list archives:
http://lists.dalsemi.com/mailman/listinfo/tini
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.