V
V
Victor Nasonov2016-05-28 19:05:43
Qt
Victor Nasonov, 2016-05-28 19:05:43

QThread::start: Failed to create thread (The access code is invalid.) How to fix?

I wrote a qt program that downloads VKontakte posts and pictures for them.
Pictures are loaded like this:

connect(netReply, SIGNAL(readChannelFinished()), &loop, SLOT(quit()));

After the program starts to take up ~ 150 mb and creates 403 threads, writes
QThread:: start: Failed to create thread (The access code is incorrect.)
tried
connect(netReply, SIGNAL(readChannelFinished()), &loop, SLOT(quit()), Qt::DirectConnection);

If I understand correctly, then fewer threads should be created.
but after running the program, the same thing happens.
Maybe somewhere there is a limit on running ~ 400 threads or on the size of the program in memory 150 megabytes.
How to remove limits or how to reduce the number of threads?

Answer the question

In order to leave comments, you need to log in

5 answer(s)
V
Viktor Nasonov, 2016-05-29
@kvonosan

Removed QNetworkAccessManager *manager and QNetworkReply *netReply and reuse them.

P
Pavel K, 2016-05-28
@PavelK

What's the point of creating more threads than can actually run in parallel?
In my opinion, the OS itself monitors the number, but it should be more than 400.
Simplified code for creating and deleting a stream in the studio.

D
Denis Bogdanov, 2015-08-30
@den-bogdanov

masonry.desandro.com
Use this.

M
Maxim Timofeev, 2015-08-30
@webinar

You apparently wrote the wrong classes for them. Do col-xs-4 for the main 3's

D
deeppines, 2015-08-30
@LucasKane

jsfiddle.net/LucasKane/ge2swm5v

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question