Qt Multithreading and network programming learning

Source: Internet
Author: User

One, QT Multithreading class learning

Qthread class, starting a new thread is starting to perform a re-implementation of Qthread::run (), run () is the default real call to Exec (), Qthread::start () starts the execution of the thread, the run () function is at start () Start execution after function call

Qmutex class, Mutex/mutex lock, lock unlock, atomic operation

The Qwaitcondition class, where a thread waits for a wake-up of another thread under certain conditions until it has been dormant for a long time. Qwaitcondition::wakeone () randomly wakes up a waiting thread, qwaitcondition::wakeall () wakes all.

Qreadwritelock provides a lock, read-write lock that can read and write at the same time, share write-time exclusive when reading, write lock priority higher than read lock

Qsemaphore provides an integer signal, which is a mutex, which specifies how many threads are allowed to operate

QT Advanced Threading Class: Qtconcurrent class Opens thread transaction, Qfuturewatcher class observes thread state, Qfuture class thread starts class

Qmutex,qreadwritelock,qsemaphore,qwaitcondition provides the means of thread synchronization, using threads primarily for concurrent execution.

Second, the network programming class in QT learning

Qtcpsocket class of reliable stream transport

Qudpsocket class unreliable large message transfer bind (), Writedatagram () write message, Readdatagram () read newspaper, Joinmulticastgroup () broadcast (Join/leave), Haspendingdatagrams () returns true if at least one message is received

Qabstractsocket class, Connecttohost (), State (), waitforconnected (), Waitfordisconnect (), ReadData (), WriteData ()

Qtcpserver class

Qlocalserver class Listen (), ServerName (), Close ()

Qlocalsocket class ServerName (), Connecttoserver (), Disconnectfromserver (), State (), Waitforconnect (), Waitfordisconnect ( )

Qhostaddress class Setaddress (), toipv4address (), Clear ()

Qhostinfo class, Lookuphost (), Abortlookuphost (), FromName () find Ip,localhostname by name ()

Qt Multithreading and network programming learning

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.