@petterihiisila - do these "Kernel stalling" error messages appear in /var/log/system.log?
If so, I don't have occurrences of that error message (or any mention of 'stalling' or 'iohid') over the past week, during which I've had the freezing issue at least twice.
I have monitored /var/log/system.log during freezes (only after they started though) and couldn't spot any message that seemed to correlate with them.
But I've not yet looked into the Console - perhaps that's where this error appears?
Also, you say that for you it only resolves with a reboot? That's definitely different to me and I think others in this thread, as for us it resolves by restarting BTT. In my case, it doesn't re-occur for four or five days after each restart of BTT.
I've not noticed any obvious correlation with CPU load or temperature. I can't yet work out what causes the issue to first start, but once it has started it will occur every time I switch application (by any means), but only on application switch. I definitely don't think I have a temperature correlation, because the last two occurrences have been late at night when general temps were much lower than they had been hours earlier. CPU usage is a possibility - the most recent occurrence started when I launched a video file from Path Finder, thus causing VLC to open, so that would have involved some activity. Though certainly nothing unusual compared to day-to-day usage. And the time before I am pretty sure I was just switching between two already-open apps, with no obvious CPU activity occurring at all. So I can't say I'm noticing an obvious CPU or temp spike associated with the start of freezing.
So your symptoms seem a little different to what I've seen so far. Presumably the same problem but presenting differently (and more severely for you, it seems, if you have to reboot.)
EDIT: I can no longe rreply to this thread because of some three-post limit for "new users". I've emailed Andreas to ask this to be removed. In the meantime I can only edit past posts. EDIT 2 : thanks Andreas, limit is now removed.
I will add here that I've just had my latest occurrence. It has happened three days, 16 hours and 20 minutes after I restarted (to install an OS update, to 10.13.6 B5). It was triggered by opening the Alfred 3 preferences window. So this time there was no correlation with Path Finder - so that was probably coincidence on previous occasions.
I can also confirm, that like @Daniel_Schroeder discovered in the next post, the issue occurs when I click on the Activity Monitor search bar. That's the only time I've noticed it happened within the same application. Maybe AM's search bar does something different to other search bars, something that makes it similar to an app switch?
One more tiny piece of info: I notice that keyboard input is not lost during the freeze. Ie if I keep typing during the freeze, all characters typed appear at the end of the freeze.
Anyway I'll post more when the 3-post limit is removed.