Special

Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 21 in printed book and digital formats -- plus a one-year subscription (beginning with 22.1) so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview


Buy Now

Issue 17.1 ('iOS Success')
Instant purchase and download via GumRoad!

COLUMN

Threads

Threads aren't so scary

Issue: 17.1 (January/February 2019)
Author: Marc Zeedar
Author Bio: Marc taught himself programming in high school when he bought his first computer but had no money for software. He's had fun learning ever since.
Article Description: No description available.
Article Length (in bytes): 16,931
Starting Page Number: 75
Article Number: 17107
Related Link(s): None

Excerpt of article text...

In the last issue (xDev 16.6) I answered a reader email about updating ProgressBars using threads. It occurred to me that I haven't written about threads in Beginner's Corner, so today we'll explore that (hairy) topic.

Threads tend to intimidate beginning programmers and thus they avoid them, but I'm here to tell you that your fears are (somewhat) overblown.

Yes, it is true that there are situations where threads can become incredibly complicated (more on that in a moment), but I've been using threads in a basic manner for years without any such trouble. I'll admit right off I'm no thread expert, but I bet you can also use threads in a simple way that will have key benefits for your programs.

What Are Threads?

Just the name, thread, sounds a little odd. Then there are associated terms like semaphore, mutex, and CriticalSection. Worst of all is hearing nightmare stories from experienced developers about problems they're having with threads. You might just decide threads are an advanced feature you should avoid.

But threads are important. Normally, Xojo code is executed while the user-interface is frozen. The program can't do anything else until that task it done.

...End of Excerpt. Please purchase the magazine to read the full article.