LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-10-2005, 04:34 PM   #1
kahn
Member
 
Registered: Feb 2004
Location: Seattle
Distribution: FC5
Posts: 109

Rep: Reputation: 15
when to start multithreaded and/or 64 bit!


Ok! I have learned C, and am on to C++ now.

Im curious as to when I should start learning multithreaded programming and to transition to 64bit programming. iI know right now it isnt a big deal, but in a couple of years(when I am more proficient at programming) It will be.

But, i have read a lot lately about lazy programming, and how this all has to change for multithreaded programming and what not.

So, what my concern is to learn right from the getgo and not develop bad habits(try not to ) And to sort of "future-proof" myself.

Also, what are differences in programming for 64bit systems? Is it just the same as 32bit but compiling on a 64bit system?

I have a 64 bit proc(system will be done by end of month) and am curious about taking it to its full potential!

Thanks a lot for your help,

Martin

PS, if anybody has any good tutorials on multithreaded or 64 bit programming, please post some good links that you would reccomend.
 
Old 07-10-2005, 06:58 PM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
If you're reasonably good at C, you can start learning and using the pthreads library right away. You canb write some simple multithreaded code and learn about things like semaphores, synchronization, and other fun topics.

As for 64 bit programming, the starting point is don't make any assumptions about the size of various data types (a good idea in general). The C standard sets minimum sizes (e.g. a char can not have less than 8 bits, but may have more, although I've yet to actually find a platform which has non-8 bit chars). Really, you just want to have your code be portable in general unless you absolute;y need to write something nonportable.
 
Old 07-11-2005, 06:54 AM   #3
cracauer
Member
 
Registered: Jul 2004
Location: Boston, MA, USA
Distribution: FreeBSD, Debian/AMD64, Ubuntu/i386
Posts: 59

Rep: Reputation: 15
Forget about 64 bits, it's trivial from a code standpoint. Just use -Wall -Werror.

Multithread programming has a much bigger impact, both on generak program design and on actually managing the synchronization in your program, aka debugging the lockups

Better start multithreading right away.
 
Old 07-11-2005, 09:58 AM   #4
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,649
Blog Entries: 4

Rep: Reputation: 3934Reputation: 3934Reputation: 3934Reputation: 3934Reputation: 3934Reputation: 3934Reputation: 3934Reputation: 3934Reputation: 3934Reputation: 3934Reputation: 3934
Multithreading is useful only when an application really does have several activities to do which are both "relatively independent of one another" and basically "I/O-bound" (not "CPU-bound"). This gives the application great flexibility in exactly what it "chooses to do next." It can enable the application to be very responsive to changing conditions.

But I would assert that the facility is usually either abused, or employed in situations where it really gives no advantage. If the natural operations of the program are basically-sequential, and already very I/O-bound, then dividing it into threads will not help. The so-called "flaming arrow approach" of handling multiple requests, as in a server, can be a disaster. ("Each new request results in a new thread, fired into the air like a flaming arrow to complete the request and then die.")

Multithreading is an important tool to master, but it should be employed judiciously.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
multithreaded socket system JanusPaul Programming 2 08-12-2005 05:58 PM
linux suse 9.2 64 bit version installation, yast fails to start up azulpind4 SUSE / openSUSE 16 07-04-2005 01:53 PM
Running wine - a bit confused on how to start it/run it silentwhispers SUSE / openSUSE 3 11-17-2004 12:15 AM
can't start ALSA (output goes to the bit bucket) yggdrasilos Linux - Software 2 01-31-2004 09:32 AM
64 Bit version.. best bet to start with?? StamfordRob Linux - Distributions 1 05-06-2003 12:29 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration