Monday, March 31, 2008

Groovy Threads

I don't know why I think this is so cool, because it's such a no-brainer, but I really like the way Groovy added closures to the Thread class:

tmp.groovy:

def stringOne = 'Hello, ';
def stringTwo = 'World!';
Thread.start{sleep(1000); println stringTwo}
Thread.start{sleep(999); print stringOne}

7 comments:

蛋泥。等你。 said...

It's cool :)

thank your share

geetha said...

) Ecorptrainings.com provides GROOVY in hyderabad with best faculties on real time projects. We give the best online trainingamong the GROOVY in Hyderabad. Classroom Training in Hyderabad India

Oracle Fusion said...

This is very informative and interesting for those who are interested in blogging field. Commenting on a blog is an art. Good comments create relations. You’re doing great work.
Oracle Fusion HCM Technical Training

Rajesh said...

It is amazing and wonderful to visit your site. Thanks for sharing this information, this is useful to me.
Oracle Fusion SCM Training in Hyderabad

Sannihitha Technologies said...

Thanks for sharing this valuable information to our vision.
You have posted a trust worthy blog keep sharing.
webdesigning course in hyderabad

Rainbow Training Institute said...

Thank you for sharing your awesome and valuable article this is the best blog for the students they can also learn.

Workday Online Training

Rainbow Training Institute said...

Thank you for sharing such a nice and interesting blog.

Workday Online Training