Go Looks Like Another C

執筆者
Jeff Cogswell
Jeff Cogswell
Published: Nov 5, 2012
Updated: Feb 2, 2021
1 minute read
Go Looks Like Another C
eWeek のコンテンツおよび製品のおすすめは、編集上の独立性を保っています。パートナーへのリンクをクリックすると、当社が報酬を得る場合があります。 詳細を見る


Go Looks Like Another C

Go Looks Like Another C

The Go language looks like another C-based language, but from a programming perspective, it feels and works more like a modern dynamic language.


Advanced Features

2

Go includes a large number of external packages with features such as compression, cryptography, image handling, Web development and operating systems support.


Additional Support

3

Recently Google has added Go to the list of languages that you can use for programming their App Engine for cloud-based development.


Go Is for Multicore

4

Go supports multicore programming natively. You can see here all eight cores peaked out as the parallel code was distributed among the cores.


Support for Closures

5

Like most modern languages, Go includes support for closures, even though it’s a strongly typed language.


‘Goroutines’

6

Although the outer loop finished, the individual “goroutines” still had access to the outer loop’s variables through closure. Each thread printed the value of the variable, “hello.”


Advertisement

Working With Each Core

7

Go lets you specify the number of cores to use as you launch your “goroutines.” Here we’re using eight cores.


How it Works

8

Because we used eight cores, no cores were left for the outer loop, which, in turn, waited until the scheduler allowed it to move forward.


Adjusting to Seven Cores

9

By adjusting the number of cores down to seven, one will be left for the outer thread.


Conclusion

10

Indeed, leaving one thread for the outer allowed the loop to finish before all the inner threads even ran.

Jeff Cogswell

Jeff Cogswell is the author of Designing Highly Useable Software (http://www.amazon.com/dp/0782143016) among other books and is the owner/operator of CogsMedia Training and Consulting.Currently Jeff is a senior editor with Ziff Davis Enterprise. Prior to joining Ziff, he spent about 15 years as a software engineer, working on Windows and Unix systems, mastering C++, PHP, and ASP.NET development. He has written over a dozen books.

eWeek Logo

eWeek has the latest technology news and analysis, buying guides, and product reviews for IT professionals and technology buyers. The site's focus is on innovative solutions and covering in-depth technical content. eWeek stays on the cutting edge of technology news and IT trends through interviews and expert analysis. Gain insight from top innovators and thought leaders in the fields of IT, business, enterprise software, startups, and more.

TechnologyAdvice が所有・運営しています。 © 2026 TechnologyAdvice. 無断転載を禁じます

広告主に関する開示:このサイトに掲載されている製品の一部は、TechnologyAdvice が報酬を受け取っている企業のものです。この報酬は、製品がこのサイトのどこにどのように表示されるか(表示される順序など)に影響する場合があります。TechnologyAdvice は、市場で入手可能なすべての企業やすべての種類の製品を掲載しているわけではありません。