Web News


India plays growing role in Intel R&D
About half of the work on Intel's recently announced "teraflop research chip" was done in India, highlighting the country's growing importance to Intel's R&D efforts. Researchers in Oregon and Bangalore designed the programmable chip, which crams 80 cores onto a fingernail-size device that draws just 62 watts...

Primavera outsources agile product development...
Primavera Systems, a vendor of enterprise project management software, has outsourced product development using the agile development process to the Indian operation of product engineering outsourcer Symphony Services. A section of developers hold that agile development is difficult to do offshore because of...

Intel India co-develops teraflops research chip
The Intel India Development Centre (IIDC) has co-developed the world's first teraflops research chip for building the next generation of high-end computers and servers to deliver supercomputer-like performance. The 80-core chip, which is less than a fingernail in...

Indian, US scientists discuss nano computing at Agra
Indo-US collaboration in broadening the horizons of research in nano and quantum computing will open up new frontiers to speed up data transmission processes and unravel the mysteries of nature, said experts at a seminar here. The Indo-US Agra workshop on soft...

India is the new China at world's biggest wireless fair
The mobile telecom industry turned its focus on India at this year's 3GSM trade fai--and away from China after years of talking about little else but China's huge market and potential third generation licenses. Vodafone's $11 billion deal to buy a controlling stake in India's fourth-biggest mobile phone firm, Hutchison Essar...

Semicon policy to trigger investment flows into India
The Indian government's semiconductor policy is expected to attract multibillion dollar investments, create more jobs and build an eco-system to make the country a manufacturing hub for chips and electronics goods. Terming the policy, which was announced Thursday...

02.26.07


Coldfusion: Object Factories And Galleon

By Raymond Camden

In my last post on object factories, I talked about how my attempt to use an object factory for Galleon had led to infinite loop.

More than one person told me to switch to ColdSpring and rethink my CFC setup in general (which I agree with), but at the same time I was curious as to why the factory didn't work when I expected it to.

Rob Gonda (who had provided the original code) was able to figure out the issue.

Let me quickly go over again the process I was using. This is a simplified version of what Galleon is doing and it will lead to demonstrating the bug.

First off - the factory's general methodology is to make a CFC and return it to you. However, it is smart enough to create singletons. By that I mean the factory would cache the CFC in the variables so on the 2nd-N calls it would return the cached version.

So when Galleon was starting up, it did this:

1. Ask for Message.cfc.

2. Factory would make a new instance and begin to set things inside it.

3. One of those things was the Thread CFC.

4. Thread CFC needs a copy of Message.cfc. It would ask the factory and a new one was made since back in step 1 the process never got finished.

5. Loop until CPU goes ape-you-know-what.

Try a Better Way Today.
Try WebEx MeetMeNow -
Click Here

So the important thing to note is that because the first process (Ask for Message.cfc) never finished, when Thread asked for a new copy, it didn't load from the cache. That was the problem.

If you take the above process and change it a bit...

1. Ask for Message.cfc.

2. Factory would make a new instance and place in cache

3. Begin to set things inside it.

4. One of those things was the Thread CFC.

5. Thread CFC needs a copy of Message.cfc. It would ask the factory and the cached one is returned.

Like most bugs - now that I see it (thanks again Rob), it is so obvious I can't believe I missed it. I still need to rework Galleon's CFCs, but I can at least get the new release out. (Look for it tonight.)

Comments

About the Author: Raymond Camden, ray@camdenfamily.com
http://ray.camdenfamily.com

Raymond Camden is Vice President of Technology for roundpeg, Inc. A long time ColdFusion user, Raymond has worked on numerous ColdFusion books and is the creator of many of the most popular ColdFusion community web sites. He is an Adobe Community Expert, user group manager, and the proud father of three little bundles of joy.

About DevWebPro India
DevWebPro India is for professional developers ... those who build and manage applications and sophisticated websites. DevWebPro India delivers via news and expert advice New Strategies In Development.

DevWebPro India is brought to you by:

SecurityConfig.com NetworkingFiles.com
NetworkNewz.com WebProASP.com
DatabaseProNews.com SQLProNews.com
ITcertificationNews.com SysAdminNews.com
LinuxProNews.com WirelessProNews.com
CProgrammingTrends.com NetworkNewz.com


-- DevWebPro India is an iEntry, Inc. publication --
iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509
2007 iEntry, Inc.  All Rights Reserved  Privacy Policy  Legal

archives | advertising info | news headlines | free newsletters | comments/feedback | submit article


New Strategies In Development DevWebPro India News Archives About Us Feedback DevWebPro India Home Page About Article Archive News Downloads WebProWorld Forums Jayde iEntry Advertise Contact