diff options
author | Eric Wild <ewild@sysmocom.de> | 2019-06-17 13:02:44 +0200 |
---|---|---|
committer | Eric Wild <ewild@sysmocom.de> | 2019-06-17 14:41:34 +0200 |
commit | ac0487eb66c07934cb13791ad625e86d580e8ab0 (patch) | |
tree | c46bdbad011d71b3b7bf31e05290d9d81c995011 /Transceiver52M | |
parent | 6a305feb0f7bdcae9d0552e5d2bca9c48ec2e63f (diff) |
Add option to set stack size in config file, default == 0 == OS default
Change-Id: Id752f6b5ce9a96a67cd1ff835687ce0e03d3a50d
Diffstat (limited to 'Transceiver52M')
-rw-r--r-- | Transceiver52M/Transceiver.cpp | 14 | ||||
-rw-r--r-- | Transceiver52M/Transceiver.h | 3 | ||||
-rw-r--r-- | Transceiver52M/osmo-trx.cpp | 2 |
3 files changed, 10 insertions, 9 deletions
diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp index 9c55d02..0aa4ff5 100644 --- a/Transceiver52M/Transceiver.cpp +++ b/Transceiver52M/Transceiver.cpp @@ -115,11 +115,11 @@ Transceiver::Transceiver(int wBasePort, size_t tx_sps, size_t rx_sps, size_t chans, GSM::Time wTransmitLatency, RadioInterface *wRadioInterface, - double wRssiOffset) + double wRssiOffset, int wStackSize) : mBasePort(wBasePort), mLocalAddr(TRXAddress), mRemoteAddr(GSMcoreAddress), mClockSocket(TRXAddress, wBasePort, GSMcoreAddress, wBasePort + 100), mTransmitLatency(wTransmitLatency), mRadioInterface(wRadioInterface), - rssiOffset(wRssiOffset), + rssiOffset(wRssiOffset), stackSize(wStackSize), mSPSTx(tx_sps), mSPSRx(rx_sps), mChans(chans), mEdge(false), mOn(false), mForceClockInterface(false), mTxFreq(0.0), mRxFreq(0.0), mTSC(0), mMaxExpectedDelayAB(0), mMaxExpectedDelayNB(0), mWriteBurstToDiskMask(0) @@ -212,7 +212,7 @@ bool Transceiver::init(FillerType filler, size_t rtsc, unsigned rach_delay, /* Start control threads */ for (size_t i = 0; i < mChans; i++) { TransceiverChannel *chan = new TransceiverChannel(this, i); - mControlServiceLoopThreads[i] = new Thread(32768); + mControlServiceLoopThreads[i] = new Thread(stackSize); mControlServiceLoopThreads[i]->start((void * (*)(void*)) ControlServiceLoopAdapter, (void*) chan); @@ -254,8 +254,8 @@ bool Transceiver::start() } /* Device is running - launch I/O threads */ - mRxLowerLoopThread = new Thread(32768); - mTxLowerLoopThread = new Thread(32768); + mRxLowerLoopThread = new Thread(stackSize); + mTxLowerLoopThread = new Thread(stackSize); mTxLowerLoopThread->start((void * (*)(void*)) TxLowerLoopAdapter,(void*) this); mRxLowerLoopThread->start((void * (*)(void*)) @@ -264,12 +264,12 @@ bool Transceiver::start() /* Launch uplink and downlink burst processing threads */ for (size_t i = 0; i < mChans; i++) { TransceiverChannel *chan = new TransceiverChannel(this, i); - mRxServiceLoopThreads[i] = new Thread(32768); + mRxServiceLoopThreads[i] = new Thread(stackSize); mRxServiceLoopThreads[i]->start((void * (*)(void*)) RxUpperLoopAdapter, (void*) chan); chan = new TransceiverChannel(this, i); - mTxPriorityQueueServiceLoopThreads[i] = new Thread(32768); + mTxPriorityQueueServiceLoopThreads[i] = new Thread(stackSize); mTxPriorityQueueServiceLoopThreads[i]->start((void * (*)(void*)) TxUpperLoopAdapter, (void*) chan); } diff --git a/Transceiver52M/Transceiver.h b/Transceiver52M/Transceiver.h index 4614efe..ceb8c4a 100644 --- a/Transceiver52M/Transceiver.h +++ b/Transceiver52M/Transceiver.h @@ -108,7 +108,7 @@ public: size_t tx_sps, size_t rx_sps, size_t chans, GSM::Time wTransmitLatency, RadioInterface *wRadioInterface, - double wRssiOffset); + double wRssiOffset, int stackSize); /** Destructor */ ~Transceiver(); @@ -178,6 +178,7 @@ private: double rxFullScale; ///< full scale output to radio double rssiOffset; ///< RSSI to dBm conversion offset + int stackSize; ///< stack size for threads, 0 = OS default /** modulate and add a burst to the transmit queue */ void addRadioVector(size_t chan, BitVector &bits, diff --git a/Transceiver52M/osmo-trx.cpp b/Transceiver52M/osmo-trx.cpp index 05489bd..06b1a18 100644 --- a/Transceiver52M/osmo-trx.cpp +++ b/Transceiver52M/osmo-trx.cpp @@ -145,7 +145,7 @@ int makeTransceiver(struct trx_ctx *trx, RadioInterface *radio) transceiver = new Transceiver(trx->cfg.base_port, trx->cfg.bind_addr, trx->cfg.remote_addr, trx->cfg.tx_sps, trx->cfg.rx_sps, trx->cfg.num_chans, GSM::Time(3,0), - radio, trx->cfg.rssi_offset); + radio, trx->cfg.rssi_offset, trx->cfg.stack_size); if (!transceiver->init(trx->cfg.filler, trx->cfg.rtsc, trx->cfg.rach_delay, trx->cfg.egprs, trx->cfg.ext_rach)) { LOG(ALERT) << "Failed to initialize transceiver"; |