« Return to Thread: [rvm-research] Log.write()

Re: [rvm-research] Log.write()

by Steve Blackburn :: Rate this Message:

Reply to Author | View in Thread

Actually within MMTk you should use the Log class.

The Log class safely and coherently buffers output for output.    
Flushing can be forced (Log.flush()).

Log is only supported within MMTk.  One day we hope to have it  
propogated to the rest of the VM.   If you're working outside of MMTk,  
you'll need to use VM.sysWriteln() as Fil mentions.    However, to  
achieve atomicity of output with VM.sysWrite* you'll need to fine a  
single sysWrite() command that can output the format you want (fine if  
you just want to output a simple string, but not good if you want to  
output something complex).   If the method you want isn't there, you  
just need to create your own.   Otherwise you won't get atomicity in  
your output, which is a problem in a multithreaded setting.

--Steve


On 13/06/2009, at 12:29 AM, Filip Pizlo wrote:

> Hi Cristian,
>
> I usually use VM.sysWriteln().  You can also use VM.tsysWriteln() to
> get the thread ID prefixed to your message (useful for debugging  
> multi-
> threaded stuff).
>
> -Filip


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Jikesrvm-researchers mailing list
Jikesrvm-researchers@...
https://lists.sourceforge.net/lists/listinfo/jikesrvm-researchers

 « Return to Thread: [rvm-research] Log.write()