iPhone Dev team has released a new beta version of redsn0w software to jailbreak iOS4 in iPhone 3G and iTouch 2nd generation devices. The Dev team could do it within hours of releasing the iOS4 update for iPhone 3G and iTouch. The new version of redsn0w (version 0.9.5) is available for both Mac and Windows.
The new software would also unlock iPhone 3G to use with a SIM card of any service provider. The jailbreaking update for iPhone 3GS and iTouch third generation are not yet available.