The Artima Developer Community
Sponsored Link

Java Buzz Forum
Episode 139 - US Debates from DrunkAndRetired.com

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Michael Cote

Posts: 10306
Nickname: bushwald
Registered: May, 2003

Cote is a programmer in Austin, Texas.
Episode 139 - US Debates from DrunkAndRetired.com Posted: Oct 17, 2008 5:05 PM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Michael Cote.
Original Post: Episode 139 - US Debates from DrunkAndRetired.com
Feed Title: Cote's Weblog: Coding, Austin, etc.
Feed URL: https://cote.io/feed/
Feed Description: Using Java to get to the ideal state.
Latest Java Buzz Posts
Latest Java Buzz Posts by Michael Cote
Latest Posts From Cote's Weblog: Coding, Austin, etc.

Advertisement

Charles dresses up

In this episode (click play above to listen to it right here), Charles and I talk about this week’s, US presidential debates.

Also, in response to last week’s 64 bit talk, Roger V. sent this in:

A 64-bit OS can access more memory because it’s using 64-bit address pointers. In C, C++, and assembly language, one deals directly with address pointers.

Whereas in Java, C#, or the myriad of various scripting languages, one is shielded from raw pointers and one doesn’t make direct calls to the OS from these mangaged languages - unless done through a special mapping or adapting mechanism.

So in Java one passes references to objects around and has no idea how big the reference is. Unlike address pointers in C, a Java reference is not directly manipulated. Now from Java, if you want to interact with the native OS, where address pointer types do matter, you have to use the JNI and write that code in C. Java interacts via JNI conventions with the C code, and the C code can interact with any native OS APIs. The C code can then deal with any 32-bit vs 64-bit conversion issues (perhaps by even dropping into some inline assembly language if necessary).

When you pass an address (like a pointer to a string buffer) to an OS API, the language signature for calling the API will make the type of address pointer (32-bit or 64-bit) very, very explicit indeed. You have to pass it the kind of address pointer that the API expects.

So 32-bit code running on a 64-bit OS has to make any system call interactions via some sort of thunk layer. Hence when I run 64-bit Firefox on 64-bit Ubuntu and attempt to use the Adobe Flash player (which to this day is still only available in 32-bit versions no matter what OS), I have to use a special adapter plugin that provides for this thunking. (Same goes for any C/C++ shared libraries - the 32-bit app will have to have 32-bit versions of its shared libraries.)

Now with Apple’s latest version of the Mac OS X, the thunking is essentially the other direction. Apple is still using an essentially 32-bit OS, but wants to provide the ability to run 64-bit software applications (Photoshop) that can address beyond 4 GB of memory. So they have a special 64-bit compatible thunking layer for such 64-bit programs that adapts OS calls down to the actual 32-bit native OS API calls. If there is a comprehensive 64-bit thunking layer for all OS APIs, then 64-bit software, including their shared libraries, can be ported to run.

If you young whipper snappers had been around programming in C or assembly back in the days of the 8088/8086/80286 and then dealt with the transition from 16-bit code (MS-DOS, Win3.0) to 32-bit architecture (Win32), this 32-bit to 64-bit thing would all be old hat. Also, if you recall, Win95 was a 32-bit API programming model that thunked down to an underlying 16-bit MS-DOS underpinning.

Hopefully 64-bit will last us longer than 32-bit has - before we have to deal with the 64-bit to 128-bit transition.

–RogerV

Read: Episode 139 - US Debates from DrunkAndRetired.com

Topic: Linux Tips: Bandwidth Monitoring, Common Commands, Accounting Previous Topic   Next Topic Topic: Joining Mozilla to create new developer tools for the Web; Hoping to create a new chapter in the...

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use